PDA

View Full Version : Rsync Backup


fatal
06-08-2006, 03:41 AM
Hello,

I have my mysql db dumped every night via cron job which labels it mon/tues/wed etc...

I want to a remote machine to download this every night, so currently the backup goes into my /home/user/backup folder and am using the command:

rsync -avz -e ssh user@domain.com:/user/backup/ /user/backup/

Is this the best command to use? is it incremental or is it going to download the mon/tues/wed ones again?

Thanks!

charles
06-08-2006, 09:24 AM
It's incremental.

However, you will soon need to do some pruning/rotating on the VPS or you'll run out of disk space. When you do that, you'll want to use the '--delete' flag on rsync to also removed the old backups on the destination side.

charles

fatal
06-08-2006, 12:19 PM
makes sense...

thanks charles!

netrider
06-17-2006, 11:46 AM
Care to share the cron job(s) you use for dumping the MySQL db and pruning teh dump files (as charles suggested) ? I like the idea of an rsync to my home server.

fatal
06-22-2006, 03:35 PM
take a look at http://freshmeat.net/projects/mysqlbackup/

I use their script and have a cron run every night.