Rsync Sync Tool Learning Notes

Source: Internet
Author: User
Tags scp command

Personal study notes, collation summary from a training course video, if there is infringement please contact the letter.


Rsync Tool Features:

1. Host-local data transfer, similar to the CP/RM command.

Cases:

650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/74/28/wKiom1YWHhuxfcmEAABzbsEqrtY614.jpg " Title= "1.jpg" alt= "Wkiom1ywhhuxfcmeaabzbseqrty614.jpg"/>

Common options AvZ, keep file attributes, similar to cp-d-p-r/ A

Cases:

650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M01/74/26/wKioL1YWH5_w9_E8AAFb884Pfmk920.jpg " Title= "2.jpg" alt= "Wkiol1ywh5_w9_e8aafb884pfmk920.jpg"/>

rsync Removal Method:

Create a new empty directory with Rsync-r--delete/empty directory/Destination directory

Note that after the directory name to add/

Cases:

650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M02/74/29/wKiom1YWIVzx0OxXAADb-cj66Ec319.jpg " Title= "3.jpg" alt= "Wkiom1ywivzx0oxxaadb-cj66ec319.jpg"/>

rsync Removal principle: Copy (delete copy)

See figure:

650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/74/27/wKioL1YWIouQb-soAAGHrQJGMQ0008.jpg " Title= "4.jpg" alt= "Wkiol1ywiouqb-soaaghrqjgmq0008.jpg"/>



2. with ssh/ The RCP channel transmits data similar to the SCP command.

Example : push file

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/74/27/wKioL1YWJPCR4t-tAACsGjxVpsU830.jpg "style=" float: none; "title=" 5.jpg "alt=" Wkiol1ywjpcr4t-taacsgjxvpsu830.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/2A/wKiom1YWJNnDZTlaAADH3Ely8YA778.jpg "style=" float: none; "title=" 6.jpg "alt=" Wkiom1ywjnndztlaaadh3ely8ya778.jpg "/>


Example: Pull file

650) this.width=650; "Src=" http://s3.51cto.com/wyfs02/M00/74/27/wKioL1YWJcWCx5B5AACOB-Qq4VM048.jpg " Title= "7.jpg" alt= "Wkiol1ywjcwcx5b5aacob-qq4vm048.jpg"/>


3. Transfer data in daemon mode. (in fact, to avoid remote host transfers using SSH Channels)

Server configuration file/etc/rsyncd.conf ( manual creation required)

UID = rsync

GID = rsync

Port = 873

Hosts allow = 192.168.0.0/24

Use chroot = no

Max connections = 200

timeout= 300

PID file =/var/run/rsyncd.pid

Lock file =/var/run/rsync.lock

Log file =/var/log/rsyncd.log

[Asling]

Path =/home/rsyncdata

Comment = rsync files

Ignore errors

Read Only = False

List = no

Auth users = Rsync_backup

Secrets file =/etc/rsync.password



Example: Pull file

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/2B/wKiom1YWMvjgFG7AAAGd1sJ1XSA081.jpg "style=" float: none; "title=" 1.jpg "alt=" Wkiom1ywmvjgfg7aaagd1sj1xsa081.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/74/28/wKioL1YWMw_BWSPBAAF2WDbZpCQ123.jpg "style=" float: none; "title=" 2.jpg "alt=" Wkiol1ywmw_bwspbaaf2wdbzpcq123.jpg "/>


avoid the need to enter a password when performing rsync transfers (common in timed task scripts):

Add--password-file=

Example:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/74/29/wKioL1YWNG7wd-r0AAGdgTmsOf8419.jpg "title=" 3.jpg " alt= "Wkiol1ywng7wd-r0aagdgtmsof8419.jpg"/>

  

This article from "Fat Linux Learning Notes" blog, declined reprint!

Rsync Sync Tool Learning Notes

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.