This how-to article will explain how to set up BackupPC on Debian / Ubuntu (should be applicable to other distros as well) for a mixed OS environment using rsync. Since the actual program that will be doing the back up is rsync, the use of bandwidth is conserved. Rsync only transfers the difference; only the new and modified files will be transferred to the backup server each time.

BackupPC comes with a web interface that each client can access separately, making it easy for each user of the service to manage the backups. For clients that can run rsync and SSH natively (ie Linux, Mac OS X, etc), there is added benefits of the security of SSH connections, as opposed to Samba (SMB) connections. For Windows, Cygwin is required to run rsync. However, sharing the folders on the network is not required and the BackupPC solution still is a good one for Windows clients.

Another cool aspect of BackupPC is that it can handle both laptops and desktops. You can configure (pretty easily) it so that it'd know if you computer is a laptop that travels around or fixed desktop. The time of the day that BackuPC does the backup depends on the type of your computer (laptop / desktop). This is great because laptop users may never have a chance to have frequent backups outside the normal busy hours (8am - 5pm) and desktop users have the luxury of having the backups take place outside their business hours so as to avoid the computer slowing down while you need to use it for your work.

I have probably convinced you that this is a great program. However, I had much trouble setting it up. Most of the how-to's and manuals out there are not really written for newbies. I had started writing these documents as a way of note keeping. After I realized that I had to pass the information onto the people at work after I am long gone (graduate students do leave someday), I re-wrote the documents for Linux newbies. Here it is; enjoy.

Printer Friendly Printer Friendly

Posted by tak, filed under linux. Date: September 8, 2007, 11:42 pm |

25 Responses

  1. jwillar Says:

    Your HOWTO is very good but I am still unsure how to install/setup BackupPC for my home network. I have three systems running Kubuntu 7.10 and my network has a 250GB NAS drive for common data storage. At first I thought BackupPC would be perfect but now seeing all your references to installing it on a server, I am having doubts. Will I need to configure my laptop as a “server”? Will this cause harm to my otherwise normal use of my laptop?

    Thanks for your effort,
    jwillar

  2. tak Says:

    Hi jwillar,

    The server can be any computer. That computer will not need to be dedicated for the backup functionality either. It will be a lot more convenient if the server is a desktop though so that it can always be on.

    If the backup server computer is not always on, it may miss the chance to download the data from the client computers, such as a laptop.

    As for harming the network, the same type and quantity of “harm” would result for both the server and the client. The only “harm” is going to be the network and the computer getting somewhat slowing down (depending on how fast your computer) while backing stuff up. After the first full backup, it will be only an incremental backup and therefore you should not notice this afterwards.

    Hope this helps. Sorry for not responding sooner. We took precaution to evacuate from San Diego this week (the San Diego wildfire).

  3. jwillar Says:

    Thanks for your time to respond to my question. I’ll give BackupPC another try. Hope you survived the SD fires intact. Thanks again.

  4. Richard Kulp Says:

    I have used your excellent instructions to set up a Ubuntu server to backup my Windows XP and Vista clients. However, I get an unexplained exit from Rsyncd on the client computer. Rather than copy all the log information, it can be seen linuxquestions.org at
    http://www.linuxquestions.org/questions/linux-server-73/rsync-has-unexplained-exit-642136/

    Tak, if you will please look at the log files and let me know if you see anything. I know this is an imposition so will understand if you are unable to do it.

    Thanks.

  5. Tak Says:

    Hi Richard,

    What did the log file from Backuppc say? It’s the log that you can look at from the web interface. Thanks.

  6. Richard Kulp Says:

    Here are the log entries:

    2008-05-14 09:21:20 full backup started for directory
    2008-05-14 09:21:20 Got fatal error during xfer (unexpected response: ‘@RSYNCD: EXIT’)
    2008-05-14 09:21:25 Backup aborted (unexpected response: ‘@RSYNCD: EXIT’)

  7. Tak Says:

    Hi,

    Have you tried to verify that the rsyncd service is properly running on your Windows machine?
    Go to “Control Panel” –> “Administrative Tasks” –> “Services” and see if “rsyncd” is running. Let us know. Thanks.

    Tak

  8. Richard Kulp Says:

    I checked that before trying the first backup. It shows that it is running. I have restarted it every time I changed rsysncd.conf just to make sure the config file was loaded.

  9. Tak Says:

    OK. When you go to the backuppc web interface and go to this client’s page, you will see a link “Edit Config” under the client’s name on the left side bar. Click on that and click on “Xfer” tab. Can you make sure that the “RsyncdClientPort” is 873 and could you post what it says (screenshot may be easier) for “RsyncArgs”? Thanks.

    Tak

  10. Richard W. Kulp Says:

    I can’t figure out how to insert a screenshot so here is the individual info:

    RsyncClientPort: 873
    Parameters:
    –numeric-ids
    –perms
    –owner
    –group
    -D
    –links
    –hard-links
    –times
    –block-size=2048
    –recursive

  11. Tak Says:

    Oh I forgot that this isn’t like a forum; you cannot insert an image. My bad.

    Those values seem OK.
    Do you have a firewall on this machine that is other than the Windows Firewall that came w/ SP2?

  12. Tak Says:

    It just occurred to me, that the “ClientNameAlias” could be the culprit. That value must be an IP address of the client AFAIK.

  13. Richard W. Kulp Says:

    I changed the ClientNameAlias to the IP address but it had no effect. I am investigating whether the cygwin1.dll and rsync.exe are incompatible versions. They should be OK but one never knows. Thanks for your help thus far.

  14. admin Says:

    How did you install rsyncd?
    Did you use the rsyncd package or did you install cygwin first and then installed rsync via cygwin?

  15. Richard W. Kulp Says:

    I used the package on the Ubuntu computer and downloaded the ctgwin-rsync package from http://backuppc.sourceforge.net. I had already done most of it before I found your page.

    If I could figure out how, I would clean off the computers and start over.

  16. girya Says:

    RWK,

    I just finished installing and configuring bupc and it was challenging. What worked for me for debugging the xtfers was running the commands from a terminal as user backuppc. I was able to change arguments to see what the error response was. I added -v argument to rsync each time I ran the command to get verbose output. For me it was name resolution and password-less authentication

    try running nmblookup and nmblookup -A to make sure you have no connection errors.

    If you want to start over on the Ubuntu box type sudo apt-get purge backuppc and that will remove the program and the config files.

    I considered installing cygwin-rsync on win box but went the smb route. good luck and keep at it i’ll try to help kevin

  17. Richard Kulp Says:

    Do you recommend that I install the ssh components on the Windows machine and go with smb, too?

  18. Richard W. Kulp Says:

    Tak or girya,

    The BackupPC documentation has the following statement: “As an alternative to setting $Conf{XferMethod} to “smb” (using smbclient) for WinXX clients, you can use an smb network filesystem (eg: ksmbfs or similar) on your linux/unix server to mount the share, and then set $Conf{XferMethod} to “tar” (use tar on the network mounted file system).

    OK. I have samba installed and the drives mounted. How do I actually set up the config file to get the directories I want? Also, do I list the mounted file system in localhost.pl or the WinXX.pl file? I have tried localhost to no avail.

    Thanks for helping me.

  19. Richard W. Kulp Says:

    Tak & Girya,

    I changed to smb and am currently backing up C$. I don’t know if the correct directories are being backed up, but at least it has not crashed. Thanks for both of your suggestions. I’ll keep you posted.

  20. Carlos Escutia Says:

    @Richard Kulp:

    I have had problems with windows firewalls. Try to disable _any_ firewall your pcs would be using, and try backing up again. If this is the culprit, you can add an exception by application (rsync) or by port (873)

    Hope it helps

  21. Chuck Bennett Says:

    Ok I’m looking into backuppc. What I want to do is put an external hard drive on my backup server. After the first back remove it and take it to the lock box. Then put an empty drive in it’s place. I want to do this every week. Since this is an incremental backup does backuppc compare the backup location vs the location being backed up? Will this even work?

  22. tom joy Says:

    Hi
    I have BackupPC application in CentOS 5.. clients are windows and RHEL machines.. I could take the Fullbackup for the client mahines ..But I can’t take the increental backup.. When I took the incremental backup , it start incremental backup, but after completion of the task .. i see that the backup directory contain full back of all the data … what is the reason? pls help me

  23. Tak Says:

    @tom joy

    BackupPC keeps the full backup because the incremental backup will only contain what was changed or has been created since the full backup. So between the full and incremental backup they have everything on your machine. Hope this helps

  24. Tak Says:

    @Chuck Bennett
    I’m not sure why you want to put in an empty HD after the 1st backup. It wouldn’t work because BackupPC needs to see the prior backup files in the prescribed place. Sorry for a late response

  25. Twitter Trackbacks for Because it matters » Blog Archive » Set up BackupPC for Mac / Win / Linux [taksuyama.com] on Topsy.com Says:

    […] Because it matters » Blog Archive » Set up BackupPC for Mac / Win / Linux taksuyama.com/?p=13 – view page – cached This how-to article will explain how to set up BackupPC on Debian / Ubuntu (should be applicable to other distros as well) for a mixed OS environment using rsync. Since the actual program that will be doing the back up is rsync, the use of bandwidth is conserved. Rsync only transfers the difference; only the new and modified files will be transferred to the backup server each time. Tweets about this link […]

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.