linux install rsync command

The rsync command prompts that the connection times out. Solution
1. Execute the visudo command under root privileges.
2. Add a line of user information under the following content
## Same thing without a password
# %wheel ALL=(ALL) NOPASSWD: ALL
ec2-user ALL =(ALL) NOPASSWD: ALL

3. Save and exit
4. Execute the file synchronization command
sudo rsync -av 172.31.7.42::xx1/style.zip /usr/local/static2/







rsync command installation steps:
1. sudo yum install rsync
2. vim /etc/rsyncd.conf has the
following code:
uid = root
gid = root
max connections = 10
use chroot = no
pid file=/var/run/rsyncd.pid
log file=/var/log/rsyncd.log

[xx1]
path = /dirname/
comment = new
read only=no

Remarks: dirname is the file directory that needs to be synchronized.
Save

and exit 3. Start the rsync service command
/usr/bin/rsync --daemon

4. Execute the file synchronization command

rsync -av ip::xx1/filename /local path

{
xx1 is the identifier
dirname is the local folder
read only = yes, it is read-only, no is to allow the external server to push back, which may overwrite old files.
}

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326288443&siteId=291194637