Rsync

=Introduction=

Rsync instance need to be installed on both server & client for rsync to work.

= One-Liners =

rsync -zvr /var/opt/installation/inventory/ /root/temp
 * Synchronize Two Directories in a Local Server

rsync -v /var/lib/rpm/Pubkeys /root/temp/
 * Synchronize Only One File

rsync -avz /root/temp/ thegeekstuff@192.168.200.10:/home/thegeekstuff/temp/
 * Synchronize Files From Local to Remote

rsync -avz thegeekstuff@192.168.200.10:/var/lib/rpm /root/temp
 * Synchronize Files From Remote to Local

rsync -avz -e ssh thegeekstuff@192.168.200.10:/var/lib/rpm /root/temp
 * Remote shell for Synchronization

rsync -avzu thegeekstuff@192.168.200.10:/var/lib/rpm /root/temp
 * Do Not Overwrite the Modified Files at the Destination

rsync -v -d thegeekstuff@192.168.200.10:/var/lib/.
 * Synchronize only the Directory Tree Structure (not the files)

rsync -avz --progress thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/
 * View the rsync Progress during Transfer

rsync -avz --partial --progress thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/ rsync -avzP thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/
 * Resume Support

rsync -avz --delete thegeekstuff@192.168.200.10:/var/lib/rpm/.
 * Delete the Files Created at the Target

rsync -avzi thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/
 * View the Changes Between Source and Destination

rsync -avz --include 'P*' --exclude '*' thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/
 * Include and Exclude Pattern during File Transfer

rsync -avz --max-size='100K' thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/
 * Do Not Transfer Large Files

rsync -avzW thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp
 * Transfer the Whole File

sudo apt-get install smbfs sudo mount -t smbfs //LASTXP21/Data /mnt/data -o username=administrator,password=,rw pkexec rsync -r -t -v --progress --ignore-existing -u -s /data/.personal/shotwell/ /mnt/data/Shotwell
 * Rsync between Ubuntu and Windows