{"id":4232,"date":"2019-09-21T23:12:06","date_gmt":"2019-09-21T20:12:06","guid":{"rendered":"https:\/\/kifarunix.com\/?p=4232"},"modified":"2024-03-12T21:53:02","modified_gmt":"2024-03-12T18:53:02","slug":"backup-windows-system-with-backuppc-using-rsyncd","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/backup-windows-system-with-backuppc-using-rsyncd\/","title":{"rendered":"Backup Windows System with BackupPC Using Rsyncd"},"content":{"rendered":"\n
This guide will take you through how to backup Windows System with BackupPC using rsyncd.<\/p>\n\n\n\n
In our previous guide, we learnt how to backup Windows system with BackupPC using Samba share (Server Message Block protocol)<\/a>. It is much safer to use Rsyncd for backup compared to using SMB.<\/p>\n\n\n\n Assuming you have BackupPC server up and running, follow through this guide to backup your Windows system.<\/p>\n\n\n\n You can also follow the same steps for your GPU Dedicated Server<\/a> or Azure Windows Virtual Desktop<\/a> etc.<\/p>\n\n\n\n You can check the link below to setup a BackupPC server on Debian 10 Buster server.<\/p>\n\n\n\n Install and Configure BackupPC on Debian 10<\/a><\/p>\n\n\n\n Since our BackupPC server uses Rsync protocol for backup, the only way we can install rsync on Windows is via the cygwin-rsyncd<\/a> windows package.<\/p>\n\n\n\n Download Cygwin-Rsyncd installer from Releases page<\/a> and and install it on your windows system.<\/p>\n\n\n\n Cygwin-rsynd is installed under Open the Next, edit the Before you can proceed, make a copy of the configuration file.<\/p>\n\n\n\n Next, create a backup share defining the directory to backup, the backup username, the credentials file, IP of the BackupPC server.<\/p>\n\n\n\n Save the configuration file and restart Rsyncd service by navigating to Task Manager -> Services -> RsyncServer. Right click it and restart the service.<\/p>\n\n\n\n If Windows firewall is running, allow Ping and TCP port 873.<\/p>\n\n\n\n To allow Ping, open Windows Firewall with Advanced Security<\/strong> > Inbound Rules<\/strong> and enable ping for Public, Domain, and Private profiles for File and Printer Sharing IPv4.<\/p>\n\n\n\n To allow TCP port 873, click on New rule > Port > TCP > Specific local port (873) > Allow Connections > (Allow connections for Domain and Private profiles). Set the name of the rule and finish it.<\/p>\n\n\n\n Next, you need to test whether you can connect to your host. Hence, login to your BackupPC server as backuppc user and run the connection test.<\/p>\n\n\n\n This can be done using the rsync command as shown below;<\/p>\n\n\n\n Where;<\/p>\n\n\n\n If the connection is successful, you should get a password prompt. When you enter the password, you will see a list of all files and directories under you share.<\/p>\n\n\n\n After the above configuration, login to BackupPC web interface and add your Windows host system and the user for backups.<\/p>\n\n\n\n Next, create the Host configuration file based on whether you are using hostnames or IP addresses. For example, to create the configuration file for the host above;<\/p>\n\n\n\n Now, set the Share Name to backup (MyDocuments), the protocol to use (rsyncd), directories or files to exclude if any. Also, the backup user and password. See the sample configuration file below;<\/p>\n\n\n\n Once you have added your Windows host, restart backuppc service.<\/p>\n\n\n\n Next, login to BackupPC user interface and confirm the settings.<\/p>\n\n\n\n Once done with the configuration, you can now run the system backup. Select the host and under Backup Summary<\/strong> page > User Actions<\/strong>, click Start Full Backup<\/strong>.<\/p>\n\n\n\n You can check the LOG files to see if there is any issue with backup.<\/p>\n\n\n\n Based on the above logs, the backup was successful. CLick browse backups to see the files and directories backed up.<\/p>\n\n\n\n You have successfully backup the data from you Windows host. This marks the end of our guide.<\/p>\n\n\n\n Related Tutorials<\/p>\n\n\n\nBacking up Windows System with BackupPC Using Rsyncd<\/h2>\n\n\n\n
Download and Install Cygwin Rsyncd<\/h3>\n\n\n\n
Configure Rsyncd on Windows System<\/h3>\n\n\n\n
C:\\rsyncd<\/code>. Within this directory are two major configuration files for rsyncd;<\/p>\n\n\n\n
\n
rsyncd.secrets<\/code> which stores the username and password for backups.<\/li>\n\n\n\n
rsyncd.conf<\/code>, which is the main configuration file for Rsync containing the files and directories to be backed up.<\/li>\n<\/ul>\n\n\n\n
C:\\rsyncd\\rsyncd.secrets<\/code> and set the username and password in the format,
username:password<\/code>. Note that the file should end in a newline. Otherwise the last username\/password pair will be ignored.<\/p>\n\n\n\n
# You also need to put your client-specific BackupPC user name in the\n# \"auth users\" setting in the c:\/rsyncd\/rsyncd.secrets file.\n#\n# On the BackupPC server, in the configuration for this client:\n# - $Conf{RsyncdUserName} should be set to whatever you replace UUU with\n# You also needs to update \"auth users\" in the\n# c:\/rsyncd\/rsyncd.secrets file.\n# - $Conf{RsyncdPasswd} should be set to whatever you replace PPP with\n# - $Conf{XferMethod} should be set to \"rsyncd\"\n# - $Conf{RsyncShareName} should be set to \"cDrive\", or whatever shares\n# you created in the c:\/rsyncd\/rsyncd.secrets file.\n#\n# SECURITY WARNING: Don't just uncomment the last line and use the defaults\n# of UUU for the user name and PPP for the password! Change them!!\n#\n# Also: make sure this file ends in a newline. Otherwise the last\n# username\/password pair will be ignored.\n#\n#UUU:PPP\nbackuppc:password<\/strong>\n<\/code><\/pre>\n\n\n\n
C:\\rsyncd\\rsyncd.conf<\/code> and configure the files and directories to backup.<\/p>\n\n\n\n
[MyDocuments]\n path = \/cygdrive\/c\/Users\/koromicha\/Documents<\/strong>\n comment = My Documents\n strict modes = false\n # Limit this share to just these users (needs to match $Conf{RsyncdUserName}\n # and the c:\/rsyncd\/rsyncd.secrets files)\n auth users = backuppc<\/strong>\n # Password to match $Conf(RsyncdPasswd)\n secrets file = c:\/rsyncd\/rsyncd.secrets<\/strong>\n # List the IP address(es) of your BackupPC server(s), so only connections from these hosts will be allowed.\n hosts allow = 192.168.56.117<\/strong>\n # Allows restores to write to this share\n read only = false\n list = false\n # git issue : https:\/\/github.com\/backuppc\/backuppc\/issues\/116\n charset=utf-8<\/code><\/pre>\n\n\n\n
Testing Connection to Windows System<\/h3>\n\n\n\n
su - backuppc\nrsync backuppc@192.168.56.122::MyDocuments<\/code><\/pre>\n\n\n\n
\n
backuppc<\/code> is the user defined in the ryncd configuration file by the auth users<\/strong> parameter.<\/li>\n\n\n\n
192.168.56.122<\/code> is the IP address of the Windows host.<\/li>\n\n\n\n
MyDocuments<\/code> is the Share name defined in the rsyncd configuration file above.<\/li>\n<\/ul>\n\n\n\n
Password: \nfile has vanished: \"\/proc\" (in MyDocuments)\ndrwxr-x--- 0 2019\/09\/21 21:03:07 .\n-rwxr-x--- 17,489 2018\/03\/07 10:03:00 ADA L7-report.xlsx\n-rwxr-x--- 17,013 2018\/03\/07 10:32:56 ADA User activity report.xlsx\n-rwxr-x--- 16,991 2018\/03\/07 10:11:36 Acc created.xlsx\n-rwxr-x--- 11,398 2019\/01\/16 15:56:09 Book2.xlsx\n-rwxr-x--- 188,764 2018\/03\/28 17:21:08 ads.pdf\n-rwxr-x--- 2,048 2019\/05\/22 09:13:18 Default.rdp\n-rwxr-x--- 867 2018\/02\/06 13:04:07 DeviceofferAccountCreated_RightsInfoChnaged.txt\n-rwxr-x--- 31,370 2018\/03\/28 10:20:36 Document3.pdf\n...<\/code><\/pre>\n\n\n\n
Add Windows Host to BackupPC<\/h3>\n\n\n\n
su - backuppc\necho \"192.168.56.122 0 backuppc\" >> \/etc\/backuppc\/hosts<\/code><\/pre>\n\n\n\n
vim \/etc\/backuppc\/pc\/192.168.56.122.pl<\/code><\/pre>\n\n\n\n
$Conf{BackupFilesExclude} = {\n 'MyDocuments' => [\n '\/*.mp4',\n '\/*.mp3'\n ]\n};\n$Conf{RsyncShareName} = [\n 'MyDocuments'\n];\n$Conf{RsyncdPasswd} = 'password';\n$Conf{RsyncdUserName} = 'backuppc';\n$Conf{XferMethod} = 'rsyncd';<\/code><\/pre>\n\n\n\n
systemctl restart backuppc<\/code><\/pre>\n\n\n\n
<\/a><\/figure>\n\n\n\n
Running Backup<\/h3>\n\n\n\n
<\/figure>\n\n\n\n