Posts

Showing posts from August, 2016

Rsync: Transferring files between two hosts

Rsync is a versatile file copying tool. It is famous for its delta-transfer algorithm, which reduces the amount of data sent over the network by sending only the differences between the source files and the existing files in the destination. Rsync also has options to delete extraneous files from the receiving side (ones that aren’t on the sending side), but only for the directories that are being synchronized.

Configuring Rsync:

rsync -av --exclude 'share/web/moodle/sessions/' --exclude 'share/wordpress/uploads/wpcf7_captcha/' --delete --rsync-path "sudo rsync" /data/ 172.31.X.X:/data/ &>/home/fsync/rsyncjob/output.


Options Description:

--archive : Copies recursively (all directories and  
            subdirectories) while preserving symbolic links, 
            permissions, file ownerships and timestamps.

--exclude : This option allows you to add rules to selectively  
            exclude certain files from the list of files to be   
            transferred …