
A Step-by-Step Guide to Backing Up Windows Systems with BackupPC and Rsyncd
Managing a mixed-OS environment presents unique challenges, especially when it comes to creating a unified and reliable backup strategy. While BackupPC is a premier open-source solution for Linux systems, integrating Windows clients can seem daunting. Fortunately, by leveraging the rsyncd transfer method, you can create a powerful, efficient, and centralized backup system for your entire network.
This guide will walk you through the complete process of configuring a Windows machine to be backed up by a BackupPC server using Rsyncd. This method is highly effective because it relies on rsync’s famous delta-transfer algorithm, which only copies the parts of files that have changed, saving significant bandwidth and storage space.
Why Choose Rsyncd for Windows Backups?
Before diving in, let’s look at the benefits of this approach:
- Efficiency: Rsync minimizes data transfer by sending only the differences between files, making backups fast and lightweight.
- Reliability: It is a mature, battle-tested protocol trusted by system administrators worldwide.
- Centralized Management: All backup jobs, scheduling, and restores are handled from your central BackupPC server.
- Security: When configured correctly, it provides a secure channel for your backup data.
Part 1: Configuring the Windows Client
The first step is to install and configure an Rsync daemon on the Windows machine you intend to back up. We will use the popular cwRsync package for this purpose.
Step 1: Install cwRsync Server
- Download the cwRsync Server installer.
- Run the installer on your Windows client. During the installation, you will be prompted to create an
SvcCWRSYNCuser. This is the service account that the rsync daemon will run under. It’s recommended to use a strong, unique password for this account. - Complete the installation. This will place the necessary files, including the configuration files we need to edit, typically in a directory like
C:\Program Files\cwRsync.
Step 2: Configure the Rsync Daemon (rsyncd.conf)
This is the most critical step on the Windows client. You need to create a configuration file named rsyncd.conf that tells the rsync daemon what to share and who can access it.
Navigate to your cwRsync installation directory and open the rsyncd.conf file in a text editor. Add the following configuration, adjusting it to fit your needs:
use chroot = false
strict modes = false
hosts allow = [IP_ADDRESS_OF_BACKUPPC_SERVER]
log file = rsyncd.log
# Define the share for the C drive
[cDrive]
path = /cygdrive/c/
read only = yes
transfer logging = yes
auth users = [backup_user]
secrets file = /cygdrive/c/Program Files/cwRsync/rsyncd.secrets
Key Configuration Parameters Explained:
hosts allow: This is a critical security setting. You must replace[IP_ADDRESS_OF_BACKUPPC_SERVER]with the actual IP address of your BackupPC server. This ensures that only your server can connect to this rsync daemon.[cDrive]: This is the name of the backup “share” or module. You will need this name when configuring BackupPC. You can name it whatever you like.path = /cygdrive/c/: This defines the root directory that will be backed up. cwRsync uses a Cygwin-like path structure, so/cygdrive/c/corresponds toC:\.auth users: The username that BackupPC will use to authenticate. Replace[backup_user]with a username of your choice (e.g.,backuppc).secrets file: The path to the file containing the password for yourauth users. The path must use the Cygwin format.
Step 3: Create the Secrets File
Next, you must create the secrets file referenced in your configuration. This file contains the username and password combination for authentication.
In the same cwRsync directory, create a new text file named
rsyncd.secrets.Add a single line in the format
username:password:backuppc:YourSuperSecretPasswordEnsure the username matches the
auth usersvalue fromrsyncd.conf.Replace
YourSuperSecretPasswordwith a strong, secure password.Security Tip: Restrict permissions on this file so that only the
SvcCWRSYNCuser and Administrators can read it.
Step 4: Start the Rsync Service
Now that the configuration is complete, you can start the service.
- Open the Windows Services console by running
services.msc. - Find the “RsyncServer” service in the list.
- Right-click it and select Start.
- It’s also a good idea to set the “Startup type” to Automatic so the service restarts after a reboot.
Part 2: Configuring the BackupPC Server
With the Windows client ready to accept connections, it’s time to configure BackupPC to pull the data.
Step 1: Add the Windows Host
First, add the new Windows client to your BackupPC configuration. This typically involves adding the host to your main /etc/backuppc/hosts file.
Next, you will create a host-specific configuration file. For a host named windows-pc, you would create /etc/backuppc/pc/windows-pc.pl.
Step 2: Configure the Host’s Backup Settings
Open the newly created host configuration file and add the following settings. This tells BackupPC to use the rsyncd method and provides the necessary credentials.
# Set the transfer method to rsyncd
$Conf{XferMethod} = 'rsyncd';
# Set the name of the share defined in rsyncd.conf
$Conf{RsyncShareName} = ['cDrive'];
# Set the authentication credentials
$Conf{RsyncdUserName} = 'backuppc';
$Conf{RsyncdPasswd} = 'YourSuperSecretPassword';
# Define files/directories to exclude from the backup
$Conf{BackupFilesExclude} = [
'/pagefile.sys',
'/hiberfil.sys',
'/System Volume Information',
'/$Recycle.Bin',
'/Windows/Temp'
];
Explanation of Key Server Settings:
$Conf{XferMethod} = 'rsyncd': This is the most important line. It switches the backup method from the default (oftensmbfor Windows) torsyncd.$Conf{RsyncShareName}: This must exactly match the share name you defined in brackets ([cDrive]) in the Windowsrsyncd.conffile.$Conf{RsyncdUserName}and$Conf{RsyncdPasswd}: These must match the credentials you created in thersyncd.secretsfile on the Windows client.$Conf{BackupFilesExclude}: This is highly recommended for performance and efficiency. Excluding large, unnecessary system files like the page file and hibernation file will significantly speed up backups and save storage space.
Step 3: Run Your First Backup
You are now ready to start your first backup.
- Log in to the BackupPC web interface.
- Select the newly configured Windows host from the dropdown menu.
- Click “Start Full Backup” for that host.
- You can monitor the progress by viewing the logs in the web interface. If there are any authentication or connection errors, the logs will provide clues to help you troubleshoot.
By following these steps, you have successfully configured a robust, efficient, and automated backup solution for your Windows systems using the power of BackupPC and Rsyncd. This setup provides peace of mind, knowing that your critical Windows data is securely managed and protected alongside your other networked machines.
Source: https://kifarunix.com/backup-windows-system-with-backuppc-using-rsyncd/


