Rsync and Windows?
Many corporate and heterogeneous networks use the rsync protocol to perform server backups or to keep files synchronized automatically from one or more directories on different machines. Linux natively incorporates the rsync utility and other associated tools, but what do you do when you need to backup Windows folders automatically from a NAS or a remote machine? One option could be to use Samba to read the contents of those folders from Linux, but it would be a fairly complex solution, because it would force us to configure Samba on the server side, set the various permissions and configuration options in Windows and place both machines on the same local network or configure complex rules on our firewall to allow SMB/CIFS traffic. And yet, the file transfer through the network would not be safe, because it would be made text clear with no encryption.
There exists a simpler solution consisting in leveraging the flexibility and security SSH provides and the simplicity and reliability of rsync to synchronize files across the network. Just need to set up an SSH server on your Windows computer and install the DeltaCopy Server software, which will serve as an rsync server.
DeltaCopy Server is set to listen on port 873 to serve requests for file synchronization in the same way the rsync daemon does.
We need to start it as a service running in the background via the main configuration console.
Finally, simply specify the virtual directories that contain the files you want to synchronize, wich will be the only visible ones from the rsync client. We have the ability to set these virtual directories as read-only to prevent them from being changed from outside and also to establish a username and password, but it won’t be necessary if we use SSH as authentication mechanism.
Command to run from the rsync client
Once you have everything set up on Windows only one thing would be to finish. Just run the appropriate command to synchronize the contents of the virtual directory on the client computer that will be responsible for performing backups, being 192.168.0.20 the Windows box, aeat the virtual directory and /var/data/backups/aeat the target directory where the synchronized files will be stored on the computer running rsync:
$ rsync -avz --delete-before 192.168.0.20::aeat /var/data/backups/aeat/
We can even use some more advanced solutions for backup like rsnapshot or rdiff-backup, since both operate on rsync.
Indika - 16/06/2017
Hi Daniel López Azaña,
I need to configure the rsync on windows server. can you please help me
Daniel - 16/06/2017
Sure, tell me the problem, please.
JACK REACHER - 30/11/2017
Baretto James - 11/12/2017
I tried deltacopy but didn’t like it. Not to mention but rsync was my favorite on linux. Been looking for similar software in windows. Found GS richcopy 360, pretty impressive work by the developers. Works really good, GUI based and as effective as rysnc!!!
sam - 18/04/2018
found GS Richcopy 360 very reliable and effective .the GUI is enhanced and much more features than robocopy
Mohan - 17/03/2020
Hi… i need to setup a home nas with openmediavault, which will be primarily used to take incremental backup of the data on my windows machine. I have tried using deltacopy, but was unable to pull the source directory on my windows machine to openmediavault. Can you please help me on this.