Rsync: Difference between revisions

188 bytes added ,  4 years ago
m (Text replacement - "; Comments Total Comments on this page = {{NUMBEROFCOMMENTSPAGE}}. ----- <comments /> -----" to "{{DISQUS}}")
 
 
(2 intermediate revisions by the same user not shown)
Line 4:
Rsync instance need to be installed on both server & client for rsync to work.
 
= One-Liners =
 
* Synchronize Two Directories in a Local Server
rsync -zvr /var/opt/installation/inventory/ /root/temp
 
* Synchronize Only One File
rsync -v /var/lib/rpm/Pubkeys /root/temp/
 
* Synchronize Files From Local to Remote
rsync -avz /root/temp/ thegeekstuff@192.168.200.10:/home/thegeekstuff/temp/
 
* Synchronize Files From Remote to Local
rsync -avz thegeekstuff@192.168.200.10:/var/lib/rpm /root/temp
 
* Remote shell for Synchronization
rsync -avz -e ssh thegeekstuff@192.168.200.10:/var/lib/rpm /root/temp
 
* Do Not Overwrite the Modified Files at the Destination
rsync -avzu thegeekstuff@192.168.200.10:/var/lib/rpm /root/temp
 
* Synchronize only the Directory Tree Structure (not the files)
rsync -v -d thegeekstuff@192.168.200.10:/var/lib/ .
 
* View the rsync Progress during Transfer
rsync -avz --progress thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/
 
* Resume Support
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/
 
* Delete the Files Created at the Target
rsync -avz --delete thegeekstuff@192.168.200.10:/var/lib/rpm/ .
 
* View the Changes Between Source and Destination
rsync -avzi thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/
 
* Include and Exclude Pattern during File Transfer
rsync -avz --include 'P*' --exclude '*' thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/
 
* Do Not Transfer Large Files
rsync -avz --max-size='100K' thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp/
 
* Transfer the Whole File
rsync -avzW thegeekstuff@192.168.200.10:/var/lib/rpm/ /root/temp
 
* Rsync between Ubuntu and Windows
sudo apt-get install smbfs