1. on the server side, set (or add) the file:/etc/rsyncd. conf. The content is as follows:
Uid = nobody
Gid = nobody
Use chroot = No
Max connections = 10
Strict modes = Yes
PID file =/var/run/rsyncd. PID
Lock file =/var/run/rsync. Lock
Log File =/var/log/rsyncd. Log
# Yang is the module name.
[Yang]
# Path is the path to be backed up
Path =/home/Linux/PDF
Comment = Linux Home data
Ignore errors
Read Only = No
Write only = No
# Addresses allowed to connect to the server
Hosts allow = *
# Reject the client address of the server
Hosts deny = 172.16.16.11
List = false
Uid = root
Gid = root
# Virtual user name
Auth users = backup
# Password File
Secrets file =/etc/server. Pass
2. Password file/etc/server. PASS content:
backup:yang123
3. Change permission: sudo chmod 600/etc/server. Pass "NOTE: This step cannot be less 」
4. Start rsync: rsync -- daemon in later service mode
Ii. Client Configuration:
(1) run the following command directly:
rsync -vzrtopg --delete --progress --exclude "*fileToExclude*" --exclude "*.log" backup@server_ip::yang /home/to/save/serverFile --password-file=/etc/server.pass
(2)/etc/server. PASS content:
Yang123