Daniel López Azaña

Theme

Social Media

Blog

GNU/Linux, Open Source, Cloud Computing, DevOps and more...

Perfom Windows backups using rsync and DeltaCopy Server

Rsync & Windows logos

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.

Rsync backup through network

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

DeltaCopy Server is set to listen on port 873 to serve requests for file synchronization in the same way the rsync daemon does.

Windows rsync listening on port 873

We need to start it as a service running in the background via the main configuration console.

DeltaCopy configuration console - start server

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.

DeltaCopy Virtual Directories

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.

Backup Server Deltacopy Rsync Rsync Backup Rsync for Windows Rsync Windows SSH SSH Windows
Daniel López Azaña

About the author

Daniel López Azaña

Tech entrepreneur and cloud architect with over 20 years of experience transforming infrastructures and automating processes.

Specialist in AI/LLM integration, Rust and Python development, and AWS & GCP architecture. Restless mind, idea generator, and passionate about technological innovation and AI.

Related articles

Putty icon

How to create a Windows SSH server

Neither version of Windows, either Windows XP, Windows 7, or 8 or more modern versions such as Windows Server 2008 or Windows 2012, provides an SSH server to use a standard way to access from other machines with different operating system and be able to run console commands, copy files, forward ports or automate logins by using public/private keys. The Microsoft alternative to this is WinRM / Powershell, but many are the chances that we will need to find a standard and compatible way to access to other systems, and what better way to do this than using the widespread and well-known SSH protocol to get into our Windows machines securely.

August 18, 2014
hot-button-ssh-command-widget-icon

Linux remote control from your smartphone via SSH button widgets

In this post I will tell you about an Android app that is extremely useful to run commands remotely on a Linux computer: Hot Button SSH Command Widget. This application allows you to launch conveniently any command you want on a remote computer through SSH only with the push of a button on the screen of your mobile phone or tablet. This not only will facilitate automation of repetitive tasks, but also is very interesting from the perspective of security for the same reasons I exposed in my Automatically lock/unlock your screen by Bluetooth device proximity post. It will allow you for example to lock and unlock the screen without having to type your password again and again in sight of other people.

July 15, 2017
Diagrama de una instancia EC2 con múltiples interfaces de red compartiendo la misma subred dentro de la misma zona de disponibilidad en AWS

How to use 2 network interfaces on the same AWS subnet in Linux

The following Linux procedure describes how to use at the same time 2 network interfaces connected to the same AWS subnet and, which is more important, how to make both communication works well internally (between hosts on the same subnet) and also externally (both interfaces visible from the Internet). This can be useful for example when you want the same EC2 instance to host a web server serving http or https requests and at the same time have a websockets server ws:// or wss:// listening on the same port 80 or 443 respectively. Although there are other ways to achieve this such as configuring Nginx to be able to discriminate web traffic (http) from websockets traffic (ws) and act as a proxy to redirect the corresponding requests to the websockets server, this other solution I propose seems simpler and to some extent more efficient because it is not necessary to redirect traffic, which will always introduce a small latency, and allows to keep both servers completely independent within the same host. The only drawback is that you will need to assign 2 Elastic IP addresses to the same EC2 instance instead of only 1, but at the same time this will give you more flexibility when establishing rules in the security groups or in the subnet NAT rules.

October 6, 2017

Comments

Indika June 16, 2017
Hi Daniel López Azaña, I need to configure the rsync on windows server. can you please help me
Daniel June 16, 2017
Sure, tell me the problem, please.
JACK REACHER November 30, 2017
nice article
Baretto James December 11, 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 April 18, 2018
found GS Richcopy 360 very reliable and effective .the GUI is enhanced and much more features than robocopy
Mohan March 17, 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.

Submit comment