Tuesday, June 26, 2012

rsync - Syncing soft-link's as soft-link

We were running rsync between 2 repositories (created on Linux OS) from many days. But we missed to handle soft-links properly. The option 'l' provided by rsync will update the soft-links in the destination server accordingly. If this option is not provided, in the destination, the directory pointed by source will be created with the soft-link name and it will be never updated at all !


Here is a usage of rsync
/usr/bin/rsync -avuzl --stats /export/kits/dpm/builds/dev/rkm root@us-repo.org:/export/kits/dpm/builds/dev


Where the options
 -a, --archive               archive mode;
 -v, --verbose               increase verbosity
 -u, --update                skip files that are newer on the receiver
 -z, --compress              compress file data during the transfer
 -l, --links                 copy symlinks as symlinks

No comments: