rsync command in bash

rsync command

rsyncUsed to synchronize files and folders from one location to another. The backup address can be local or remote.

rsyncImportant functions:

  • speed: The first time you use, rsyncin sourceand destinationcopy the entire contents between. The next time it is used, rsynconly the changed block or byte is transmitted to the destination, and this mechanism will greatly increase the transmission speed
  • security: rsyncAllow sshprotocol encryption for data
  • less bandwidth: rsyncUse the method of compressing and decompressing data blocks to reduce bandwidth requirements.
  • privileges: No special privileges are required to runrsync

rsync option

-v: --Verbose Verbose
-qoutput mode: -quiet Simplified output mode
-c: -checksum Turn on the check switch to force the file transfer to be verified
-a: -archive archive mode, which means to transfer files recursively and keep all file attributes, equal to -rlptgoD
-r: –Recursive Recursive processing of subdirectories
-z: compression

Case

Transfer files remotely

rsync -avz ./xxx/yy/  user00@ip:/xxx

Guess you like

Origin blog.csdn.net/Free_time_/article/details/107978249