rsync Command Detailed

Source: Internet
Author: User
Tags ssh port

Detailed parameters
-a archiving mode, equivalent to-rlptgod- D is equivalent to--devices--specials-G Maintain group consistency before and after file transfer-L Keep Symbolic links-O Keep the owner consistent before and after file transfer-p maintain consistent permissions before and after file transfer-R Recursive Transfer-T maintain consistent modification time before and after file transfer-u do not overwrite the target file if the target file is modified more than the modified time of the source file-v shows the process of transferring files- W transfer all Files-z transfer files in a compressed manner--delete Delete The target directory there is, and the source directory does not have files--existing only synchronize files that are common to source and destination files--password-file= file get  password from file--progress Show the transfer progress of each file--max-size=size does not transfer files larger than size --min-size=size does not transfer files smaller than size 

Common parameter combination:-AVZ

Example

Copy all files under the/wwwroot directory of the current host to the 192.168.1.1/wwwroot directory:

rsync -avz /wwwroot root@192.168.1.1:/wwwroot

Copy all files under the/wwwroot directory of the current host to the 192.168.1.1/wwwroot directory, but exclude the log directory:

rsync -avzP --exclude="log" /wwwroot root@192.168.1.1:/wwwroot

Suppose we need to copy the/root/file of the remote host (192.168.1.1,ssh port number 222) to the/tmp directory of the current host, we can do this:

‘ssh -p 222‘ root@192.168.1.1:/root/file /tmp/

rsync Command Detailed

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.