[Box Backup] Backup File Order

Luca Lesinigo boxbackup@fluffy.co.uk
Tue, 18 Dec 2007 09:46:59 +0100


Il giorno 03/dic/07, alle ore 22:50, Chris Wilson ha scritto:
>> needed. But e.g. for MySQL they are. The database directory (e.g.
>> /var/lib/mysql/) must be excluded and another directory which holds  
>> the
>> database dump must be included. Before the backup of the dump- 
>> directory
>> the pre-script must run.
>> Alternatively (for low-traffic sites) a pre-script could stop  
>> mysqld and
>> a post-script could start it. Therefore no dump is necessary.
If you don't want (or can't afford, for eg. disk space issues) to  
generate a complete dump of your database, you can get a read lock,  
flush the tables [
http://dev.mysql.com/doc/refman/5.0/en/backup.html ], and then safely  
backup the data directory of mysql.

If you're able to get a snapshot of the filesystem (eg., UFS2 on  
freebsd, LVM2 on linux, ZFS on solaris) you can release the lock right  
after snapshotting for the minimum possible interference in the db  
operations, and then run your backup off the snapshot - no dump, no db  
shutdown, no long db lock necessary. Cool. :)

--
Luca Lesinigo
LM Networks Srl