Rsync

General use

Use of “/” at the end of path:

  • Source :

When using “/” at the end of source, rsync will copy the content of the last folder. When not using “/” at the end of source, rsync will copy the last folder and the content of the folder.

  • Destination :

When using “/” at the end of destination, rsync will paste the data inside the last folder. When not using “/” at the end of destination, rsync will create a folder with the last destination folder name and paste the data inside that folder


Rsync for copy and show progress for files :

rsync -p --progress SOURCE/file.x DESTINATION/

Mirror a folder (for BKP)

rsync -avuh --info=progress2 --delete SOURCE/ DESTINATION/
  • -a : archive mode, archive mode allows copying files recursively and it also preserves symbolic links, file permissions, user & group ownerships and timestamps
  • -v : verbose
  • -u, –update skip files that are newer on the receiver
  • -h : human-readable, output numbers in a human-readable format
  • –info=progress2, show the progress pourcentage and time raimining
  • –delete option to delete files that are not there in source directory

Date : 2020.10.13