Brad Alexander wrote:
> Mat Enders wrote:
> > Is there anything else that should be included.
I find /var/backups to contain very useful information such as the
names and versions of all packages that are installed which is useful
to a recovery. Here is a minimum list for me.
/etc
/home
/usr/local
/var/backups
/var/mail
/var/spool/cron
If you use /srv then it would have local data too.
> What I do for my mysql boxes is that I wrote a script to do a
> mysqldump, since I don't think that restoring /var/lib/mysql will work
> cleanly.
Yes. For an example I do this in /etc/cron.d/local-mysql:
30 3 * * * root umask 077 ; mysqldump --defaults-file=/etc/mysql/debian.cnf --all-databases | gzip > /var/backups/mysql.dump ; savelog -q -d -l -C /var/backups/mysql.dump
That dumps a copy of the data and uses savelog to make datestamped
files so that it backs up nicely. For example from a system here:
-rw------- 1 root root 11755247 2012-04-04 03:30 mysql.dump.20120404033012
-rw------- 1 root root 11755247 2012-04-05 03:30 mysql.dump.20120405033030
-rw------- 1 root root 11755248 2012-04-06 03:30 mysql.dump.20120406033012
-rw------- 1 root root 11755248 2012-04-07 03:30 mysql.dump.20120407033013
-rw------- 1 root root 11755247 2012-04-08 03:30 mysql.dump.20120408033016
-rw------- 1 root root 11755247 2012-04-09 03:30 mysql.dump.20120409033016
-rw------- 1 root root 11755248 2012-04-10 03:30 mysql.dump.20120410033013
> You can then do a pre-command to dump the db before the backup:
> $Conf{DumpPreUserCmd} = '$sshPath -q -x $host sudo /usr/local/sbin/dbdump';
Since I do the db dump daily by cron I simply backup the daily dumped
file. But certainly running the dump in the DumpPreUserCmd script
would cause the backup to have the latest copy of the db as possible.
A good way to do it.
Bob
Attachment:
signature.asc
Description: Digital signature