Perfom Windows backups using rsync and DeltaCopy Server

Rsync and Windows?

Rsync and Windows logos

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.

5 Comments

    • Jesus nava 30/07/2015
  1. Raul de la Cruz 25/08/2015
  2. JOSE RIVERA 01/09/2015
  3. Kevin Zuñiga Torres 27/01/2016

Leave a Reply

Your email address will not be published. Required fields are marked *