Pages

Showing posts with label RSYNC. Show all posts
Showing posts with label RSYNC. Show all posts

Sunday, June 26, 2011

RSYNC

1. # rsync -ae ssh server1:/home /home/backups/server1_home_backup/

This command will download all the files/Directories from the sever1 to local /home/backups/server1_home_backup

-a = archive mode. This will preserve permissions, timestamps, etc

-e = specify which remote shell to use. In our case, we want to use ssh which follow right after “e”

2. # rsync -zave ssh --progress server1:/home /home/backups/server1_home_backup/

-z = adds zip compression.

-v = verbose

–progress = my favorite parameter when I am doing rsync manually, not so good when you have it in cron. This show progress (how_many_files_left/how_many_files_total) and speed along with some other useful data.


3. rsync --delete-after -zave ssh --progress server1:/home /home/backups/server1_home_backup/


–delete-after = this will delete files on backup server which are missing from source after ALL syncing is done. If you don’t care of having extra files on your backup server and have plenty of disk space to spare, do not use this parameter.


4. rsync --delete-after -zave ssh --progress server1:/home /home/backups/server1_home_backup/ -n

The -n (or –dry-run) parameter is great to use for testing. It will not transfer or delete any files, rather will report to you what it would have done if it was ran with out -n parameter. This way you can test it with out destroying or transfering data just to find out that is not what you wanted.