Rsync is easy to use and can enhance operation security if used properly. In addition, it can also be used as a security detection tool, without the support of any other software, you can complete the Integrity audit of the file system.
Rsync uses 1. resumable data transfer. You can resume data transfer when you use rsync-avzP xxx remotehost:/xxx, see the "Shell" section in "How to Apply rsync:
If the transmission is interrupted during the file copy process, rsync deletes some copied files from the target machine by default. If you do not need to re-copy all files during the next copy, you can use the-partial option to prevent rsync from deleting the copied part during the transmission interruption. If you want to use both the-partial and-progress options, you can use the-P option, which is a more convenient option provided by rsync and can replace the two.
However, you must note that the-z parameter cannot be included when you need to resume the data transfer; otherwise, the Data fails.
Rsync 2. When cwrsync is used in windows, you can write the cwrsync directory to the system environment variable, so that you do not need to run the rsync command in the installation directory of cwrsync every time.
Rsync usage 3. When you need to connect to files in windows, the drive letter cannot be directly similar to c: \; d: \, and so on. Conversion is required:
- Example : C:\WORK\* --> /cygdrive/c/work/*
- Example 1 - rsync recursively to a unix server with an openssh server :
- rsync -r /cygdrive/c/work/ remotehost:/home/user/work/
- Example 2 - Local rsync recursively
- rsync -r /cygdrive/c/work/ /cygdrive/d/work/doc/
- Example 3 - rsync to an rsync server recursively :
- (Double colons?? YES!!)
- rsync -r /cygdrive/c/doc/ remotehost::module/doc
Rsync is used. 4. When you need to transfer files from a linux system to a windows system, you can perform reverse transfer. The specific operation is as follows:
Rsync-avzP remotehost:/home/user/work/xx. xx/cygdrive/c/work/