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
October 26th, 2007 at 6:00 pm
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
October 27th, 2007 at 11:14 am
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).
November 7th, 2007 at 8:09 pm
Thanks for your time to respond to my question. I’ll give BackupPC another try. Hope you survived the SD fires intact. Thanks again.
May 18th, 2008 at 5:37 pm
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.
May 18th, 2008 at 7:21 pm
Hi Richard,
What did the log file from Backuppc say? It’s the log that you can look at from the web interface. Thanks.
May 19th, 2008 at 5:54 pm
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’)
May 21st, 2008 at 6:37 am
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
May 21st, 2008 at 8:12 am
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.
May 21st, 2008 at 8:53 am
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
May 21st, 2008 at 6:23 pm
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
May 22nd, 2008 at 8:43 am
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?
May 22nd, 2008 at 8:49 am
It just occurred to me, that the “ClientNameAlias” could be the culprit. That value must be an IP address of the client AFAIK.
May 22nd, 2008 at 11:52 am
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.
May 22nd, 2008 at 12:23 pm
How did you install rsyncd?
Did you use the rsyncd package or did you install cygwin first and then installed rsync via cygwin?
May 22nd, 2008 at 5:59 pm
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.
May 24th, 2008 at 6:57 pm
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
May 25th, 2008 at 4:37 am
Do you recommend that I install the ssh components on the Windows machine and go with smb, too?
May 26th, 2008 at 3:54 pm
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.
May 29th, 2008 at 1:36 pm
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.
November 27th, 2008 at 7:43 am
@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
July 14th, 2010 at 10:38 am
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?
October 7th, 2010 at 10:05 pm
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
October 8th, 2010 at 8:31 am
@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
October 8th, 2010 at 8:34 am
@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
November 19th, 2010 at 6:25 pm
[…] 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 […]