Elliott
This will dump the mysql dbs
signal-event pre-backup
And after your backup is complete don't forget to run:
signal-event post-backup
You might also consider rdiff-backup. Gordon Rowell has put this into a couple of easy to use RPM's. I use it daily to perform local (to USB disks) and remote backups. Works very well and does incremintal backups and saves previous versions of every file (6 weeks by default).
However: CAUTION this is beta so use at your own risk!
http://mirror.contribs.org/smeserver/releases/7/smedev/i386/RPMS/smeserver-rdiff-backup-0.0.1-19.el4.sme.noarch.rpmhttp://mirror.contribs.org/smeserver/releases/7/smedev/i386/RPMS/rdiff-backup-1.1.7-2.el4.sme.i386.rpmEdit: You should use yum to install.
# yum --enablerepo=smedev install *rdiff-backupAnd some notes to go with it:
# sudo /sbin/e-smith/config show rdiff-backup
# rdiff-backup=service
EnableLocal=yes
EnableRemote=no
Hour=2
LocalPath=/media/usbdisk/rdiff-backup
Minute=8
RemoteHost=timtam
RemoteIdentity=/root/.ssh/id_rsa_rdiff-backup
RemotePath=/var/backup/rdiff-backup
RemotePort=22
RemoteUser=rdiff-backup
RemoveOlderThan=6W
status=enabled
In the configuration above, my local backup is enabled, and backs up to
/media/usbdisk1/rdiff-backup/$sysconfig{SystemID}/
The remote backup is currently disabled, but backups up to a host called
'timtam' using the SSH key shown above, with target path of
/var/backup/rdiff-backup/$sysconfig{SystemID}/
The remote backup is done as user 'rdiff-backup' remotely (root locally).
To enable LOCAL backups:
- mount the media you want to use for backups, create the directory on the
mounted device for the backup (this must be <target directory>/rdiff-backup)
and then make sure /media/usbdisk/rdiff-backup is owned by rdiff-backup.
# mount /media/usbdisk (adjust mount point according to your system setup).
# mkdir /media/usbdisk/rdiff-backup
# chown rdif-backup:rdiff-backup /media/usbdisk/rdiff-backup
Note: Currently /media/xxxx devices are not automounted by default.
You must mount the intended media after each bootup or the backup won't work.
This mounting process may be automated in the future
- Set your configuration:
# config setprop rdiff-backup LocalPath <whatever>/rdiff-backup
# config setprop rdiff-backup EnableRemote no
# config setprop rdiff-backup EnableLocal yes
# config setprop rdiff-backup status enabled
# expand-template /etc/crontab
To enable REMOTE backups:
- install smeserver-rdiff-backup on both ends
- This will create a 'rdiff-backup' user
On the machine to be backed up:
# config setprop rdiff-backup RemoteHost <whatever>
# config setprop rdiff-backup RemotePath <whatever>/rdiff-backup
# config setprop rdiff-backup EnableRemote yes
# config setprop rdiff-backup EnableLocal no
# config setprop rdiff-backup status enabled
# expand-template /etc/crontab
# ssh-keygen -t rsa -f /root/.ssh/id_rsa_rdiff-backup -N ''
# expand-template /root/.ssh/config
On the backup server:
- Create OR Append /root/.ssh/id_rsa_rdiff-backup.pub to
~rdiff-backup/.ssh/authorized_keys2
Note: Permissions should also be 0400 rdiff-backup:rdiff-backup
Note2: If both ends are trusted then you can put the ssh in root's .ssh directory and run the remote as root. This will mantain proper file ownership. Otherwise all the backup files are saved as the user rdiff-backup.
# usermod -p '*' rdiff-backup # This enables SSH only
Note: You can enable both Local and Remote backups at the same time. rdiff-backup
will perform the local backup first then the remote.
Note: Always use a subdirectory 'rdiff-backup'. If the backup disk
isn't mounted, this saves you from filling the parent filesystem.