Server:
Ensure Rsync is installed.
Configure/etc/rsyncd. conf. Generally, Rsync is installed and does not automatically create rsyncd. conf. The configuration is as follows:
# Rsync configuration file
Secrets file =/etc/rsyncd. Secrets # name and location of the authenticated user name and password file
Motd file =/etc/rsyncd. motd # Welcome file, which can be edited by yourself
Read> List = Yes
Uid = root
Gid = root
Use chroot = No
Max connections = 5
Log File =/var/log/rsyncd. Log
PID file =/var/run/rsyncd. PID
Lock file =/var/run/rsync. Lock
# Remote Sync configuration module
[Testsync]
Comment = testsync directory
Path =/home/chijianqiang
Auth users = rsync
Generate Password File
Echo "rsync: Password">/etc/rsyncd. Secrets
Chmod 600/etc/rsyncd. Secrets
Start rsync
Rsync -- daemon
Synchronize files from the client
Rsync-vzrtopg -- Progress rsync@10.11.3.3: testsync/home/chjq
Rsync-vzrtopg -- delete -- Progress rsync@10.11.3.3: testsync/home/chjq
When the -- delete parameter is added, files in the original chjq directory are deleted to ensure the consistency between the client and the server file system. Use it with caution.