本文转载出处:
本文介绍了如何使用rsync服务从Linux到Windows进行远程备份
rsync官网下载
cwrsync官网下载环境
192.168.88.129为rsyncserverCENTOS5.532位,rsync源码包安装 下面开始安装:tarzxvfrsync-3.0.8.tar.gzcdrsync-3.0.8./configuremake&&makeinstallln-s/usr/local/bin/rsync/usr/bin/rsyncmkdir/etc/rsyncdtouch/etc/rsyncd/rsyncd.conftouch/etc/rsyncd/rsyncd.passwdchmod600/etc/rsyncd/rsyncd.passwdvi/etc/rsyncd/rsyncd.motd输入欢迎信息
Welcometorsyncsystemvi/etc/rsyncd/rsyncd.conf输入:
uid=root
gid=rootmaxconnections=36000usechroot=nomotdfile=/etc/rsyncd/rsyncd.motdlogfile=/var/log/rsyncd.loglogformat=%t%a%m%f%btransferlogging=yessyslogfacility=local3pidfile=/var/run/rsyncd.pidlockfile=/var/run/rsyncd.lockhostsallow=192.168.88.128,192.168.10.0/24hostsdeny=*timeout=300[data]
path=/optignoreerrors=yesreadonly=nolist=yesignoreerrorssecretsfile=/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脚本,添加到计划任务每天自动同步@ECHOONd:cd"D:\\\\ProgramFiles\\\\cwRsync\\\\bin"rsync.exe-avzrtopg--progress/cygdrive/e/backup