安装:yum install -y rsync
密码内容:zhangsan:123456
配置文件:/etc/rsyncd.conf内容
# /etc/rsyncd: configuration file for rsync daemon mode
# See rsyncd.conf man page for more options.
# configuration example:
uid = root
gid = root
use chroot = no
max connections = 200
port = 873
pid file = /var/run/rsyncd.pid
log file = /var/log/rsyncd.log
lock file = /var/run/rsync.lock
exclude = lost+found/
transfer logging = yes
timeout = 900
read only = yes
ignore nonreadable = yes
# dont compress = *.gz *.tgz *.zip *.z *.Z *.rpm *.deb *.bz2
# [ftp]
# path = /home/ftp
# comment = ftp export area
[beifen]
path = /www/wwwroot/ceshi/public/storage
transfer logging = yes
auth users = zhangsan
secrets file = /etc/rsyncserver.password
启动:
/usr/bin/rsync --daemon 或者 rsync --daemon
关闭和重启:
windows bat备份脚本:
@echo off
set RSYNC_HOME=C:\Program Files (x86)\cwRsync\bin
cd %RSYNC_HOME%
C:
rsync -avz --port=873 --progress --delete --password-file=/cygdrive/d/rsyncpass/rsyncclient.password zhangsan@192.168.153.128::beifen /cygdrive/d/ceshitb
windows端密码文件: