本文转载出处:

本文介绍了如何使用rsync服务从Linux到Windows进行远程备份

rsync官网下载

cwrsync官网下载

环境

192.168.88.129为rsyncserverCENTOS5.532位,rsync源码包安装

下面开始安装:
tarzxvfrsync-3.0.8.tar.gz
cdrsync-3.0.8
./configure
make&&makeinstall
ln-s/usr/local/bin/rsync/usr/bin/rsync
mkdir/etc/rsyncd
touch/etc/rsyncd/rsyncd.conf
touch/etc/rsyncd/rsyncd.passwd
chmod600/etc/rsyncd/rsyncd.passwd

vi/etc/rsyncd/rsyncd.motd输入欢迎信息

Welcometorsyncsystem

vi/etc/rsyncd/rsyncd.conf输入:

uid=root

gid=root
maxconnections=36000
usechroot=no
motdfile=/etc/rsyncd/rsyncd.motd
logfile=/var/log/rsyncd.log
logformat=%t%a%m%f%b
transferlogging=yes
syslogfacility=local3
pidfile=/var/run/rsyncd.pid
lockfile=/var/run/rsyncd.lock
hostsallow=192.168.88.128,192.168.10.0/24
hostsdeny=*
timeout=300

[data]

path=/opt
ignoreerrors=yes
readonly=no
list=yes
ignoreerrors
secretsfile=/etc/rsyncd/rsyncd.passwd

linux上启动:
rsync--daemon--config=/etc/rsyncd/rsyncd.conf第二次启动时要删除/var/run/rsyncd.pid文件在启动

rsynclinuxtowindows同步

我安装在D盘ProgramFiles

D:\\\\ProgramFiles\\\\cwRsync\\\\bin\\\\rsync.exe-avzrtopg--progress/cygdrive/e/backup

cwrsync和rsync有点区别cygdrive后面接win的盘符,直接输入盘符是不行的

下面写个bat脚本,添加到计划任务每天自动同步
@ECHOON
d:
cd"D:\\\\ProgramFiles\\\\cwRsync\\\\bin"

rsync.exe-avzrtopg--progress/cygdrive/e/backup