How to Install and Configure rsync on Windows Server for Automated Backups
This guide walks through the required environment, Windows Server rsync installation, configuration of rsyncd.conf and password files, service startup, port verification, and client-side commands to achieve reliable, scheduled file synchronization between Windows machines.
Environment
1. Sync target: test data
2. Server: Windows Server 2008 R2
3. Client: Windows 7 Ultimate 64‑bit
4. Server rsync version: cwRsyncServer_4.1.0_Installer.exe
5. Download links for rsync client and server: https://pan.baidu.com/s/1kHQSVEODxbtXpxxMnT1S2A (extraction code: 9q4m)
Server Installation Guide
Server Configuration
Directory Structure
Modify rsyncd.conf
<code>use chroot = false
strict modes = false
uid = 0 # 0代表不限定用户
gid = 0
logfile = rsyncd.log
[testwin]
path = /cygdrive/d/u01/nc_backup/ # Windows backup directory needs /cygdrive prefix
ignoreerrors
readonly = false
transfer logging = yes
auth users = test_rsync # rsync virtual user
secrets file = etc/rsyncd.password # password file path
hostsallow = * # all hosts can access</code>Create password file
In the
etcdirectory, create
rsync.passwordwith the content:
<code>test_rsync:test4321</code>Start the service and verify the port
Client Synchronization
Run the following command from the client’s
bindirectory (or add it to the PATH):
<code>rsync.exe -avz --password-file=rsync.password [email protected]::testwin /cygdrive/f/testwin_rsyncdir</code>Server data view
Client data after synchronization
Automate with a scheduled task
Configure a Windows scheduled task to run the rsync command periodically, achieving automatic backup to the target machine.
Raymond Ops
Linux ops automation, cloud-native, Kubernetes, SRE, DevOps, Python, Golang and related tech discussions.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.