HowTo use rsync for backup to disk
e-smith release:  4.1.x/SME5
Author:  Darrell May
Contributor:  

Problem:  You want to perform a backup to disk

Solution:  Use rsync to perform a file by file backup to disk.


Rsync performs a file by file archive so it does not encounter file size limitations that a single backup file would. Using a few command line arguments it can be a great tool for performing a backup to disk.  You could back up to a second hard drive, a remote samba shared hard drive, or even a second directory tree on the same drive.

The first time you run this command you would backup everything from the source to the destination.

rsync -auv source destination

The next time you execute this command it will only copy files newer then the destination making your second backup VERY fast. As this simply does a file by file copy, restores are easy.

If you want to test this out, simulate a backup to disk by copying a cdrom to disk:

[root@sme5 /root]# mount /mnt/cdrom
[root@sme5 /root]# rsync -auv /mnt/cdrom/ /root/backup

Then run the command again:

[root@sme5 /root]# rsync -auv /mnt/cdrom/ /root/backup

Pretty fast the second time wasn't it!!!

Also supports an unlimited number of --exclude parameters on the command line for skipping files/dirs:

[root@sme5 /root]# rsync -auv --exclude /dir/file --exclude /dir /mnt/cdrom/ /root/backup

'man rsync' for more details, if 'man' is installed ;->