Several rsync commands

Source: Internet
Author: User

After the rsync server configuration is complete, the next step is to issue the rsync command on the client to back up the files on the server to the client. Rsync is a very powerful tool, and its commands have many special options. The following describes the options one by one.

The Command Format of Rsync can be as follows:
Rsync [OPTION]... SRC DEST
Rsync [OPTION]... SRC [USER @] HOST: DEST
Rsync [OPTION]... [USER @] HOST: SRC DEST
Rsync [OPTION]... [USER @] HOST: SRC DEST
Rsync [OPTION]... SRC [USER @] HOST: DEST
Rsync [OPTION]... rsync: // [USER @] HOST [: PORT]/SRC [DEST]

For the preceding six command formats, rsync has six different working modes:
1) copy a local file. This mode is enabled when the SRC and DES paths do not contain a single colon ":" separator. For example, rsync-a/data/backup
2) use a remote shell program (such as rsh and ssh) to copy the content of the local machine to the remote machine. This mode is enabled when the DST path address contains a single colon ":" separator. For example, rsync-avz *. c foo: src
3) use a remote shell program (such as rsh and ssh) to copy the contents of the remote machine to the local machine. This mode is enabled when the SRC address path contains a single colon ":" separator. For example, rsync-avz foo: src/bar/data
4) copy files from the remote rsync server to the local machine. This mode is enabled when the SRC path information contains the ":" separator. Such as: rsync-av root@172.16.78.192: www/databack
5) copy files from the local machine to the remote rsync server. This mode is enabled when the DST path information contains the ":" separator. Such as: rsync-av/databack root@172.16.78.192: www
6) List of remote machine files. This is similar to rsync transmission, but you only need to omit the local machine information in the command. For example, rsync-v rsync: // 172.16.78.192/www

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.