Install Rsync

aptitude update
aptitude install rsync

Use rsync

Backup from source to destination

rsync -a source/ destination/
or
rsync -av source/ destination/

a - archive
v - verbose; show more information

Backup over ssh

rsync -a -e ssh source/ username@remotemachine.com:/path/to/destination/
or
rsync -av -e ssh source/ username@remotemachine.com:/path/to/destination/

a -archive
e -remote shell
v -verbose; show more information

Trailing slashes

Source: source/myfile.txt

rsync -a source destination

Destination: destination/source/myfile.txt

vs

Source: source/myfile.txt

rsync -a source/ destination

Destination: destination/myfile.txt

--delete

rsync -a --delete source/ destination/

a - archive
delete - To delete a file in destination if it is not in source

rsync incremental backups

rsync always unlinks hard linked files before overwriting

rsync way does full backup once, instead of once per week You can't rsync to a tape

rsyncd deamon

vi /etc/default/rsync

RSYNC_ENABLE=true

cp /usr/share/doc/rsync/examples/rsyncd.conf /etc/rsyncd.conf 

sudo /etc/init.d/rsync start

rsync localhost::ftp

drwxr-xr-x        4096 2009/06/17 21:55:55 .

Troubleshooting

Timestamp

--modify-window=10

Bibliography

MyWiki: rsync (last edited 2009-09-06 02:49:39 by localhost)