Once upon a time, Valeri Galtsev galtsev@kicp.uchicago.edu said:
On 4/3/20 8:34 AM, John Pierce wrote:
Do note, backup systems that use rsync or similar file by file copies
of a
running system do not make coherent atomic snapshots, so things like relational databases should be excluded from those, and backed by
database
tools
Long ago I learned to back up databases by dumping them (with a flag "lock" or similar to make sure no changed are made during dump), and backing up dump file.
It isn't just databases - there are other things that backing up individual files one at a time is not so good. The best way to handle that is to freeze/snapshot the whole filesystem, and then back up the snapshot. This can be scripted pretty easily if the filesystem is on LVM.
Even better is to freeze _all_ filesystems simultaneously - this is usually easiest if the system is a virtual machine and/or the storage is on a SAN with snapshot capabilities.
Then again, to get a _really_ consistent backup, you can only terminate all applications who read/write files, or instruct the applications to go into a state which allows consistent file backups. Of course after the backup you have to instruct the applications to go on with the work. You can not achieve this consistency even with freezing _all_ filesystems simultaneously. That's why usually RDBMS's and other more complex applications provide their own backup mechanism embedded into the application.
That's why rsnapshot backups are not so much worse than filesystem snapshots.
Regards, Simon