Rsync: commands of Linux on local & remote host.

rsync is a free software computer program for Unix and Linux like systems which synchronizes files and directories from one location to another while minimizing data transfer using delta encoding when appropriate.

Installation :

yum install rsync

rpm
–ivh
rsync.*

rsync command common options:

  • delete : delete files that don’t exist on sender (system)
  • v : Verbose (try -vv for more detailed information)
  • e “ssh options” : specify the ssh as remote shell
  • a : archive mode
  • r : recurse into directories
  • z : compress file data

Same local computer:

rsync -av /source/folder /destination/folder

From local to remote computer:

rsync –progress –partial –avz /folder/to/copy/ user@remote.server:/remote/folder

 

 

From remote to local computer:

 

rsync --progress --partial -avz user@remote.server:/folder/to/copy/ /local/folder

Synchronize two folders with rsync:

From one folder to another on the same server:

 

rsync -av --delete /source/folder /destination/folder

From local to remote computer:

rsync -avz –delete /source/folder user@remote.server:/destination/folder

From remote to local computer:

rsync -avz --delete user@remote.server:/source/folder /destination/folder

backup your files to an external drive, this what I usually do:

rsync -av --delete /home/guillermo/ /media/disk/backup-guillermo/

 


 

Author: VaibhaV Nanoti

Hi, I am VaibhaV Nanoti & Certified with Linux, MCITP & Cisco. I has experience in handling implementation projects related to Linux, windows & Network topology .I have also published several papers globally on Linux, Windows and Network(LAN,MAN,WAN) technology.

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.