From ArchWiki
Revision as of 18:28, 28 February 2008 by Jfgomez86 (talk | contribs)
Jump to: navigation, search

Simple Rsync Backup Howto

First: Open a terminal and do:

sudo vim /etc/cron.daily/rsync.backup

Paste this code there:

DATE=`date +%Y%m%d%H%M`
rsync -avrzhP --log-file=/var/log/backups/$DATE.log --delete /home/ /home.bck/ &> /dev/null

Make it executable:

sudo chmod +x /etc/cron.daily/rsync.backup

and that's it... it'll run every day as a cron job (meaning you have to have cron configured and working)

NOTES: Watch really good the commands -avrzhP is the main backup options, --log-file well, is the log file created with the backup date --delete means that files that you delete from the source dir will also be deleted from the backup dir. /home/ (you can change it) is the source /home.bck/ is the destination dir (which i have it on another hard drive but it doesn't matter).

--Jfgomez86 13:28, 28 February 2008 (EST)

I would suggest you though to look for other backup methods if this one doesn't suit you... it's very simple as you can see but it works for me.