I would like to know a suitable backup strategy for a small business running a simple database. The whole system operates from a single local computer with one internal hard disk. I have already looked into some backups utilities such as rsync and dump but wasn't sure which is more appropriate for this type of scenario.As a specific example, I wish to understand whether a backup utility like rsync is suitable for copying data from a database, MySQL or not, and storing into a external hard drive.
What is an adequate backup strategy for Debian system with a simple database?
linux;debian;backup
You asked,whether a backup utility like rsync is suitable for copying data from a database, MySQL or notThe answer here is an emphatic No!.Unless you are prepared to switch off MySQL while you perform an rsync-based backup you will almost certainly end up with a corrupted database on your backup. (The live system would remain unaffected and working correctly.) The reason for this is that the database system can and will update different parts of different files at different times. rsync blithely ignores this and copies the files as it finds them.As an example, consider two interrelated files A and B. A gets copied with rsync. While that's going on B is updated by the database system. Now the database system applies related updates to A but rsync has finished with A and is starting on B. The backup now contains two valid files A and B but they are out of sync with respect to each other.To backup a database you need to use tool that understands the database system. MySQL includes such tools in the package and you should use those to backup the database. (You can then copy the resulting database backups to your external disk drive using rsync or any other other preferred utility.)