A very complete program for doing backups is rsync. What makes rsync ideal is its algorithm, which compares in the default file system configuration the local and remote files one 4k block at a time using checksums and only transfers the blocks that have changed. this algorithm is very efficient and has been used in other backups software, even comercial ones.
rsync can work from the command line or by running a rsyncd daemon on the server.
In the example below rsync is used to mirror a directory
rsync --avz --delete elen@servervirto1:/home/elen/website backup/
with the above command we will mirror the remove directory structure /home/elen/website on the local server.
the option -a will make rsync run in archive mode, the v option is to make rsync be more verbose, the z option is to compress the files, the --delete option will make rsync delete any files on the local system that no longer esist on the remote server.
For day to day backups you can have rsync do 7 days incremental backups as shown below
rsync --delete --backup --backup-dir=/backups/backup-`date +%A` -avz elen@servervirto1:/home/elen/website /home/backups/current-one/
when you run this command, all the files from /home/elen/website on the remote server servervirto1 are copied to the local directory /home/backups/current-one. all files modified today are copied to a directory named after the current day, for example /backups/backup-Monday/. in a week Perio 7 directories wil be created.
- Email, SSL
- 23 Users Found This Useful