三叶草 发表于 2021-11-4 12:39:15

Windows rsync服务器备份配置实例

command:rsync -vzrtopg --progress --delete --exclude=*.txt rsync@192.168.1.9::test /cygdrive/f/a

服务器端rsyncd.conf实例:
服务器端软件下载地址https://www.uoften.com/softs/16780.html

use chroot = no
#strict modes = false
hosts allow = *
log file = rsyncd.log
pid file = rsyncd.pid
uid=administrator
gid=administrator
max connections=4
# Module definitions
# Remember cygwin naming conventions : c:\work becomes /cygwin/c/work
#

path = /cygdrive/j/byq/pdf
ignore errors
read only = yes
auth users=rsync
transfer logging = yes
secrets file = /cygdrive/c/rsync.pas

服务器端c:\rsync.pas实例:
rsync:12345
当然你也可以在当前目录下新建一个rsync.pas但上面的secrets file = rsync.pas即可

客户端软件https://www.uoften.com/softs/16779.html
客户端使用备份命令:
rsync -vzrtopg --progress --delete --exclude=*.tmp rsync@192.168.1.9::test /cygdrive/f/a
备份时应注意--delete选项,依目标而定

客户端bat文件实例:

@echo off
title fileserver mirror backup......
rsync -vzrtopg --progress --delete --exclude=*.tmp rsync@192.168.1.9::test /cygdrive/f/a

最后备份时可将客户端命令写成bat,批处理,再添加到系统的计划任务执行。
https://www.uoften.com/serverhost/winhost/20180415/80405.html
页: [1]
查看完整版本: Windows rsync服务器备份配置实例