BackupPC SetUp: with rsyncd on Windows XP without Cygwin

BackupPC Set-UP with rsyncd on Windows XP

This page is for the Windows client. "Client" is the computer being backed up by the server.

This is an executable of 'rsync' (a Linux program) that is accompanied by the DLL of Cygwin (a software that allows Windows to run Linux things).

Pre-requisites

  • Windows XP
  • IP address
  • List of folders you want backed up OR...
  • List of folders you don't want backed up
  • ~15-20 min of your time
  • You do not have Cygwin installed (and you will NOT).

WARNING: If you currently have Cygwin installed or are planning on getting it, these instructions may break your Cygwin software. In that case, you must either install 'rsync' through Cygwin. Please see the other set of instructions.



1. Download the software package (zip)

Get it here!
Sourceforge.net (get the 'zip' package)



2. Unpackage it

make a folder named 'rsyncd' in C:

unzip the content into C:\rysncd



3. Edit Configuration Files

1.) rsyncd.secrets file

Located at C:\rsyncd\rsyncd.secrets

The file should look like this:

#
# The format of this file is user:password. You can have as many entries
# as you wish. These accounts are sepecifc to the rsync daemon and share
# no relation to Windows local/domain accounts, nor Cywin entries in the
# passwd file.
#
# SECURITY WARNING: Don't use these defaults of UUU for the user name
# and PPP for the password! Change them!!
#
# Also: make sure this file ends in a newline. Otherwise the last
# username/password pair will be ignored.
#
UUU:PPP

Read the instructions. As it says, make sure that the last line is a new blank line. Replace 'UUU' with a username (no, it does not code for phenylalanine). You can just make up this username. Replace 'PPP' with a real password (should at least have numbers and alphabets).

2) C:\cygwin\rsyncd.conf File
Required modification:

Find the following section:

#
# What user(s) have access to this module. The user(s) must be
# defined in the secrets file. A comma or space separated list.
#
# Example:
# auth users = backup, root, larry
# auth users = backup root larry
#
auth users = username, backuppc

Where it says 'auth users = .....', replace any existing name(s) with the username that you placed in 'rsyncd.secrets' file AND add the user 'backuppc' (as shown in the example above).

Also find the following section in the file.

#
# What hosts are allowed access to this module? By default, all
# hosts are allowed access. If you wish to further strengthen
# the security of your setup, uncomment and replace with the IP
# address your BackupPC server. This is a flexible setting and
# can be one of:
#
# a dotted decimal IP address: 172.16.0.17
# a address/mask in the form a.b.c.d/n: 172.16.0.0/24
# an address/mask in the form ipaddr/maskaddr: 172.16.0.0/255.255.255.0
# a hostname: backupserver
# a hostname pattern using wildcards: backup*
#
# hosts allow =

hosts allow = xxx.xxx.xxx.xxx

IMPORTANT: Make the same modifications for the variables shown at the end of the file. ie for

  • hosts alow
  • auth users

Optional Modifications.

By default, the backup software will back up practically everything in your 'C:\Documents and Settings'folder. If you want to specify the folders to be backed up, find the following section and modify.

#
# Exact DOS style path to the file or directory to be rsync accessible
#
path = c:/Documents and Settings
#
# A short description of the module. This is what is printed when
# using rsync to 'browse' the server for what modules are available.
#
comment = Documents and Settings

Note that the slash is forward (not backward).
Also note that everything inside the specified folder will be backed up. However, you can exclude certain folders by specifying them on the config file on the server; you can let the administrator know what folders to be excluded.
Moreover, you can only specify one path here (to specify multiple paths, see below). Here is an example,

path = c:/stuff/important_stuff/really_important_stuff

The 'comment' should only be 1 line. It would be a good idea to write this description for future reference

Automatic Restoration - if you would like BackupPC to automatically restore files on your computer (ie the backup server has the privilege to write to your computer), then you must turn on this option (it's off by default). If you are planning on backing up system files so that you can restore the system (not just the data), this may be a good idea.
Otherwise, you will have to download the desired files/folders from BackupPC and manually restore them.

To turn on the option, find the following section and change 'true' to 'false'

#
# Only allow clients to READ from the server. This prevents uploads
# from remote machines. If you wish to allow uploads, change this too
# "true".
#
# WARNING: Setting this to true means that BackupPC restores via
# rsyncd will fail. You most likely want to set this to "false".
#
read only = true



4. Change the Permission

Now we want to make the 'resyncd.secrets' file read-only.

C:\rsyncd\rsyncd.secrets

To do this, right click the file and choose 'Properties.'

Check where it says 'Read-Only'



5. Set Up rsyncd Service

Next, set up the rsync job as a service to be started at boot-up.

Click on Start --> Run

type 'cmd' and press enter. In the terminal,

cd \rsyncd

Then,

cygrunsrv.exe -I rsyncd -e CYGWIN=nontsec -p c:/rsyncd/rsync.exe -a "--config=c:/rsyncd/rsyncd.conf --daemon --no-detach"

*the second command is a long one liner. You must issue these commands without any misspelling.

To test to see if the above command was properly issued,

Go to Control Panel --> Administrative Tools --> Services

Find 'rsync' and click on 'start' to see if the service starts properly.



6. Open a Port

Finally, open a port for rsync in the firewall.
Control Panel --> Firewall --> Exceptions

  • Name: rsyncd
  • Port number: 873
  • Type: TCP



7. Submit config files to Administrator

Now the final step is to create and submit configuration files to the administrator.
cleintname.pl file

Copy and paste the following in Notepad:

# Tell BackupPC we wish to use rsyncd: requires rsync to be running as
# a service/daemon on the client system
#
$Conf{XferMethod} = 'rsyncd';
#
# Tell BackupPC which user name and password to use. This should
# match the userName:password pair in the C:\rsyncd\rsyncd.secrets
# file on the client.
#
$Conf{RsyncdUserName} = 'username';
$Conf{RsyncdPasswd} = 'password';
#
# Tell BackupPC which share to backup. This should be the name
# of the module from C:\rsyncd\rsyncd.conf on the client (the
# name inside the square brackets). In the sample rsynd.conf
# file the cDrive module is the entire C drive.
#
$Conf{RsyncShareName} = 'cDrive';
#
# Link the IP address to the host name
$Conf{ClientNameAlias} = 'XXX.XXX.XXX.XXX';

Now change the bolded items; username and password.

For the '$Conf{RsyncShareName}' item, leave it as it is if you have not done the optional modification in the 'rsyncd.conf' file (see above). But change it to 'docs' if you have.

Also change the IP address in the $Conf{ClientNameAlias} section to your IP address.
Save the above file as 'clientname.pl' where 'clientname' is the name of your computer.
You can find your computer name by:

Control panel --> System
Then send this file to the administrator and nicely ask them to place the configuration file on the server ASAP.

Having Multiple Directory Paths

Find the following section at the end of the 'rsyncd.conf' file, copy and paste it at the end of the file (so as to have duplicates of the entire section).

[cDrive]
path = c:
comment = Entire Drive
auth users = UUU
secrets file = c:/rsyncd/rsyncd.secrets
# hosts allow = 172.16.0.17
strict modes = false
read only = true
list = false

Then change the section name within the bracket (ie [cDrive]) for the newly created (pasted) section(s).
You can change it to whatever you like, but no space please.
Modify the bolded items according to the descriptions above (note that these entries are exact copies of the main section of the rsync.conf file; they just don't have the # comments sections).
Now change the $Conf{RsyncShareName} = 'cDrive'; section of the 'clientname.pl' file to the following format.

$Conf{RsyncShareName} = ['cDrive', 'docs', 'name_you_made_up', 'another'];

Note that these entries are supposed to be the same as the names in [] in the rsync.conf file.



8. Connect & Back-up!

After you have heard back from the administrator, do the following to connect. Bookmark the address below and go to it;

http://xxx.xxx.xxx.xxx/backuppc

Now a pop-up window will ask you for the username and password. These are the ones the administrator gave you.

You should see something similar to below:

screenshot

Click on 'Start Full Backup' button to start your first backup. Note that this first backup will take a while. The next time you back up, it will be an 'incremental' backup and should only take a few minutes.
If you get any error messages, let the administrator know of that message



9. Retrieve backed-up data

To restore files / folders, simply click on 'browse backups' link on the left menu.

screenshot

You should see a screen like the above.

Then click the checkboxes next to the files and folders you want to restore and click on 'restore selected files.'

Once you click on 'restore selected files,' a screen like the below should show up. There are 3 options to what to do with the files / folders you've selected.

screenshot
  • Option 1: Direct Restore
  • Option 2: Download Zip archive
  • Option 3: Download Tar archive

Option 1 will write the backed up files / folders to your harddrive (if the same file is there, it will overwrite).

Option 2 and 3 will archive the files / folders and let you download the archived package as .zip or .tar respectively. This feature has other potential uses than just backup / restoration; you can access the backed up files / folders from anywhere in the world!

To do a complete system restoration, follow the same direction as above for all files & folders through KNOPPIX or something equivalent.


BackupPC Manual Start Page

Printer Friendly Printer Friendly

11 Responses

  1. ambarish Says:

    Hi,
    I tried using backuppc with the help of your tutorial.
    My setup is explained below.
    I have a windows 2003 server (member server).A Lacie 2TB HDD is attached to this.
    I am using backuppc in an Ubuntu server.
    I want to take the files from the 2003 server to the linux box.
    The backup was working fine,and when i tried now,i am getting an error in the log file

    2009-01-05 04:25:24 full backup started for directory docs (baseline backup #4)
    2009-01-05 04:25:24 Got fatal error during xfer (failed to open lock file)
    i am not sure if the lock file is showing from the windows machine or the linux.
    please advice

  2. Tak Says:

    The only “lock file” I’m aware of is in the windows client box in C:\cygwin\
    Have you looked in the cygwin directory?

  3. smileheart Says:

    Hi,
    I managed to install and configure backuppc.
    Thank you very much for that wonderful guide.
    Unfortunately after starting a full backup for large files,backuppc works for sometime then stops.I am taking the backup to DROBO which is connected to the network using DROBOSHARE.After some time,the mounted drobo gets disconnected i guess,due to some reason.Please help me to fix this.
    thanks.

  4. Tak Says:

    I have seen that rsync (backend of backuppc) refuses to deal with files larger than a couple of gigabytes. To this day, I haven’t come with a solution for this.
    Your error may be due to something else as well. Could you post your OS and error message? Thanks.

  5. RD Says:

    First of all thanks for the guide! I have followed it to a t. I am however unable to backup. I have had to create the C:\cygwin folder and drag the file rsyncd.conf from the folder C:\rsyncd to C:\cygwin. I also placed the cygwin1.dll file into the C:\Windows\System32 folder. I open a cmd prompt and cd \rsyncd and then run rsync localhost:: and then get “rsync: failed to connect to localhost: Connection refused (111). Suggestions?

  6. Tak Says:

    RD,

    You’re welcome.
    You should actually place all the files for rsyncd in C:\rsyncd if you have never used and will never use Cygwin.
    If you already have Cygwin installed, you must follow the other guide.
    Please read the first part of this page.

    Tak

  7. MvdM Says:

    Hi, we’re a couple of years now happy Backuppc users. It helped us preventing loss of data more than once. We have 33 hosts in Backup. For 2 hosts Backuppc says that the connection is refused. (backup failed (inet connect: Connection refused)) The reason is that the rsync proces isn’t running. I installed everything more than once but I can’t find a good way to keep the rsync process running. Strange enough both hosts are Dell Latitude E5400 laptops with Windows XP SP3. Do you have suggestions or a solution?

  8. Paul Says:

    Excellent guide.

    I followed your guide to backup three PCs with WinXP SP3 for a few months without any problem.

    However, since last week, once of my PC can’t start rsyncd.

    Event Viewer of WinXP shows:

    Event Type: Error
    Event Source: rsyncd
    Event Category: None
    Event ID: 0
    Date: 10/24/2009
    Time: 10:57:09 PM
    User: NT AUTHORITY\SYSTEM
    Computer: THINKPAD
    Description:
    The description for Event ID ( 0 ) in Source ( rsyncd ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. You may be able to use the /AUXSOURCE= flag to retrieve this description; see Help and Support for details. The following information is part of the event: rsyncd: PID 3684: starting service `rsyncd’ failed: fork: 11, Resource temporarily unavailable.

    I have no idea why fork failed. The machine has 3G of memory. I have other machine running winXP and McAfee as this one, but other machine has no problem.

    If can give me any hint about how to solve this, that would be wonderful.

  9. Paul Says:

    my problem is solved.
    It turned out to be from Google desktop

    http://cygwin.com/ml/cygwin/2009-08/msg00866.html

    what puzzles me is that google desktop has been running for long time. Don’t understand why the problem only shows up recently.

  10. Fernando Says:

    Your instructions are great.
    It worked at the first try!

    Thanks for your work, it’s much appreciated,

  11. Andrew Says:

    I’ve found that with our Dells (4 of them, all Optiplex desktops), that you have to allow incoming ICMP echo requests. To get there, go the Control panel->Windows Firewall->Advanced tab->Check Local Area Connection and Click the Settings… button->ICMP tab and check “Allow incoming echo request”.

Your input counts! Please make this site more interesting by leaving your comments, questions, blurb, etc. Thank you!

*
To prove you're a person (not a spam script), type the answer to the math equation shown in the picture. Click on the picture to hear an audio file of the equation.
Click to hear an audio file of the anti-spam equation

Your comment or question

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>

Please note: Comment moderation is enabled. However, unless you use foul language or include too many links, it should be not be put in the moderation queue.

Posted by tak, filed under Uncategorized. Date: September 8, 2007, 10:31 pm |