Friday, November 12, 2010

rsync info

Here is a summary of the few usable options:

Use the options like these examples:
rsync -rv
rsync -arv
rsync -arvz

r = recursive - means it copies directories and sub directories
v = verbose - means that it prints on the screen what is being copied
a = archive - means that symbolic links, devices, attributes, permissions, ownerships, etc. are preserved in the transfer
z = compress - compress file data

More Examples:

# rsync -r /CustomersArt/ /Volumes/Backup/CustomersArt/
The above example will copy the content of CustomersArt to /Volumes/Backup/CustomersArt/

# rsync -r /CustomersArt /Volumes/Backup/CustomersArt
The above example will copy the folder CustomersArt and its content to /Volumes/Backup/CustomersArt (it will create the folder: CustomersArt).

When using "/" at the end of source, rsync will copy the content of the last folder.
When not using "/" at the end of source, rsync will copy the last folder and the content of the folder.

When using "/" at the end of destination, rsync will paste the data inside the last folder.
When not using "/" at the end of destination, rsync will create a folder with the last destination folder name and paste the data inside that folder.