rsync command
rsync
Used to synchronize files and folders from one location to another. The backup address can be local or remote.
rsync
Important functions:
speed
: The first time you use,rsync
insource
anddestination
copy the entire contents between. The next time it is used,rsync
only the changed block or byte is transmitted to the destination, and this mechanism will greatly increase the transmission speedsecurity
:rsync
Allowssh
protocol encryption for dataless bandwidth
:rsync
Use 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
-q
output 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