Rsync remote Synchronization Service

Source: Internet
Author: User
Tags inotify rsync options
Common rsync options-A: Archive mode, equivalent to-rlptgod-V: Display Synchronization Process details-Z: Enable compression during transmission-H: retain the hard connection file-: preserve the ACL attribute information of a file -- delete: delete a file with a target but no source -- checksum: determines whether to synchronize the file based on the checksum.
1. Release rsync-daemon sharing 1) create a synchronization account file (not required if anonymous) [[email protected] ~] # Vim/etc/rsyncd_users.dbruser: 123456 // one user record per row othername: 123456 ...... [[Email protected] ~] # Chmod 600/etc/rsyncd_users.db // The permission must be strict; otherwise, synchronization will fail.

2) create/etc/rsyncd. conf sharing settings

[[Email protected] ~] # Vim/etc/rsyncd. confuid = nobodygid = nobodyuse chroot = yeslog file =/var/log/rsyncd. logpid file =/var/run/rsyncd. PID [tools] Path =/usr/src comment = rsync share test read only = Yes dont compress = *. GZ *. bz2 *. tgz *. zip // applicable to various compressed files auth users = ruser // who is allowed to access secrets file =/etc/rsyncd_users.db // specify the path of the account file

2. upload and download of rsync + rsync servers

[[Email protected] ~] # Rsync // browse Shared Password: // verify password drwxr-XR-x 4096 2009/10/01 22:58:39 debugdrwxr-XR-x 4096 2009/10/01 22:58:39 kernels... [[email protected] ~] # Mkdir/root/mysrc [[email protected] ~] # Rsync-avz -- delete/root/mysrc // downstream synchronization to delete unnecessary files

3. Rsync real-time synchronization (inotify monitoring and triggering)

1) install the inotify-tools software package

[[Email protected] ~] # Tar zxf inotify-tools-3.13.tar.gz [[email protected] ~] # Cd inotify-tools-3.13 [[email protected] inotify-tools-3.13] #./configure... [[email protected] ~] # Make & make install2). inotifywait tool trigger Verification
Take the monitoring/root directory as an example. When the documents under the/root directory change, the corresponding prompt [email protected] ~] is immediately displayed. # Inotifywait-mrq-e modify, move, create, delete, attrib/root/create, isdir tdir1/root/create file1.txt/root/modify file1.txt/root/delete file1.txt

Rsync remote Synchronization Service

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.