Difference between revisions of "Rsync"

From ArchWiki
Jump to: navigation, search
(marked as stub)
Line 1: Line 1:
== Simple Rsync Backup Howto ==
= Simple Rsync Backup Howto =

Revision as of 15:23, 16 April 2008

Tango-document-new.pngThis article is a stub.Tango-document-new.png

Notes: please use the first argument of the template to provide more detailed indications. (Discuss in Talk:Rsync#)

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).

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.

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