Using Rsync sync under Linux

Source: Internet
Author: User
Tags rsync

Rsync Introduction: Data Backup tool (with push-pull feature)

Characteristics:

The entire directory tree and file system can be saved in a mirror.

It is easy to keep the original file permissions, time, soft connection and so on.

Install without special permissions.

Fast: When you synchronize for the first time, rsync copies the entire content, but only the modified files are transferred the next time. Rsync enables compression and decompression during data transfer, so less bandwidth can be used.

Security: You can use SCP, SSH and other means to transfer files, of course, you can also through the direct socket connection

Supports anonymous transfer for site mirroring.

Rsync uses:

The command format for rsync can be in the following six ways:

rsync [OPTION] ... SRC DEST

rsync [OPTION] ... SRC [[Email protected]]host:dest

rsync [OPTION] ... [[email protected]] HOST:SRC DEST

rsync [OPTION] ... [[email protected]] HOST::SRC DEST

rsync [OPTION] ... SRC [[Email protected]]host::D EST

rsync [OPTION] ... rsync://[[email protected]]host[:P ort]/src [DEST]

Rsync has six different modes of operation:
1. Copy the local file; when the SRC and dest path information does not contain a single colon "." This mode is started when separated.

2. Use a remote shell program to copy the contents of the local machine to the remote machine.

3. Use a remote shell program to copy the contents of the remote machine to the local machine.

4. Copy files from the remote rsync server to the local machine.

5. Copy files from the local machine to the remote rsync server

6.rsync-avz commands that are commonly used

The following examples illustrate the six different modes of operation of Rsync :

1) Copy the local file. This mode of operation is initiated when both the SRC and des path information do not contain a single colon ":" delimiter.
such as: Rsync-a./test.c/backup

2) Use a remote shell program (such as rsh, SSH) to copy the contents of the local machine to the remote machine. The mode is started when the DES path address contains a single colon ":" delimiter.

such as: Rsync-avz test.c [Email protected]:/home/user/src

3) Use a remote shell program (such as rsh, SSH) to copy the contents of the remote machine to the local machine. This mode is started when the SRC address path contains a single colon ":" delimiter.

such as: rsync-avz [email protected]:/home/user/src./src

4) Copy files from the remote rsync server to the local machine. This mode is started when the SRC path information contains the "::" delimiter.

such as: rsync-av [email Protected]::www/databack

5) Copy files from the local machine to the remote rsync server. The mode is started when the DES path information contains the "::" delimiter.

such as: rsync-av/databack [email protected]::www

6) The list of files for the remote machine is listed. This is similar to the rsync transfer, but only if the local machine information is omitted from the command.

such as: Rsync-v rsync://172.16.78.192/www


Using Rsync sync under Linux

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.