Rsync is synchronized through services

Source: Internet
Author: User

Based on the C/S architecture, client and server. The server starts the service, rsync, listening port 873, and the port can be customized,
To edit the configuration file/etc/rsyncd. conf

rsyncd. conf example
Port = 873 # listening port, which can be customized. Restart the port after modification
log file =/var/log/rsync. log # specify the log file
PID file =/var/run/rsyncd. pid # specifies the PID file. The file applies to process management operations such as starting and stopping services.
address = 192.168.133.130 # the IP address is bound. If not bound, the IP address is 0.0.0.0, indicating all IP addresses.
[test] # specify the module name, content customization.
Path =/tmp/rsync # If no directory exists, you can set the permission to 777 to facilitate testing and specify the path for storing data.
Use chroot = true # indicates that only content in the path defined by path can be synchronized. The reason for doing so is to implement additional security protection, but the disadvantage is that you need to use the roots permission and cannot back up the directory files pointed to by the external symbolic connection. By default, the chroot value is true. If your data contains a soft connection file, we recommend that you set it to false.
MAX connections = 4 # specify the maximum number of connections. The default value is 0, that is, there is no limit.
Read Only ture | false # if it is true, the module cannot be uploaded to the path specified by this module.
List = true # indicates whether the module is listed when you query available modules on this server, if it is set to true, It is listed, and if it is set to false, it is hidden.
uid = root # specify the user/group used for transferring the file.
gid = root # specify the user/group used for transferring the file.
auth users = test # auth users: Specifies the user name to use during transmission.

Secrets file =/etc/rsyncd. passwd # specify the password file,/etc/rsyncd. passwd can create a file in this path and set the password. Format: User name: password. If this parameter is not specified together with the preceding parameter, no password verification is used.
Note that the permission for this password file must be 600.
For example: rsync-AVP [email protected]: Test/1.txt/tmp/test1.txt when auth users and secrets file are set, the client also needs to use the user name and password to connect to the server, to add a password to the command line, you can set a password file.
For example, VIM/tmp/rsync_pass directly enters the password in this text document, and the permission is changed to 600
Rsync-AVL [email protected]: test/test1 // tmp/test8/-- password-file =/tmp/rsync_pass # -- password-file =/tmp/rsync_pass specifies the password file path

Hosts allow = 192.168.133.132 1.1.1.1 2.2.2.2 192.168.133.0/24 # indicates the host that is allowed to connect to the module. It can be an IP address or a network segment. If there are multiple hosts, separate them with spaces. Which IP address is used to connect to the machine.

Start the service rsync -- daemon
Format: rsync-AVP/tmp/test1.txt 192.168.133.130: Test/1.txt # synchronize/tmp/test1/to the path 192.168.133.130/tmp/rsync and change the name to 1.txt, [] indicates the module name. The module name indicates the path/tmp/rsync.
If an error is reported, use Telnet to check whether the firewall is enabled.

Rsync-AVP 192.168.133.130: Test/1.txt/tmp/test1.txt # Pull the 1.txt file of rsyncunder/tmpof 192.168.133.130 to the local directory and change it to test1.txt

Rsync-AVP -- Port 8730 192.168.133.130: Test/1.txt/tmp/test1.txt # -- Port 8730 specifies port 8730

Rsync is synchronized through services

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.