microloft.co.uk     

HOWTO: Install BackupPC on Ubuntu

to Backup Windows

 

A few notes to help me, and maybe others, to quickly setup BackupPC on Ubuntu to backup Windows

I setup BackupPC on an Ubuntu Desktop box to backup a Windows 2003 Server. (I've no doubt that it will backup most Windows boxes.) I chose the simplest route to backup Windows which is to use the 'smb' method to backup Windows Shares. This means you will need to setup shares in Windows for everything you want to backup. You can of course choose to backup all of the C drive by selecting the hidden share called C$. You will also need to create the name of a Windows user with sufficient privaledges to access the files to be backed up. The method I've outlined below uses the web interface built into BackupPC

VERY IMPORTANT - Ubuntu 8.10 will not run the web interface built into BackupPC due to a fault in the smbclient package and how it passes the password back to itself. I therefore used Ubuntu 8.04 and it worked fine

1 - Install Ubuntu on the backup box

2 - Install BackupPC on Ubuntu, the easiest way is to use the package manager but if you prefer the command line:

sudo apt-get install backuppc rsync libfile-rsyncp-perl par2 smbfs

Once installed the web interface username and password will be displayed, for example:
username: 'backuppc'
password: 'fCcp33IM'

3 - If you want to change the password to something more memorable:

htpasswd /etc/backuppc/htpasswd backuppc

4 - BackupPC can now be managed through its web interface, so for example I typed the following into my web browser to access the BackupPC interface:

http://192.168.0.100/backuppc/

or you can substitute the Windows box name instead of ip address if you have a proper DNS record for it

4a - If you don't get a login prompt then run this command:

dpkg-reconfigure backuppc

where you will be asked:

Add aliases for /backuppc/ to your apache config files ? <-- Yes

4b - then go to http://192.168.0.100/backuppc/ and log in with the username backuppc and backuppc's password:

5 - Next we need to edit the hosts file to tell BackupPC which computer(s) to backup

sudo nano /etc/backuppc/hosts

Read the comments on how to use this file before scrolling to the bottom to add the windows box

[...]
winserver 0 winuser
localhost 0 backuppc

You can comment out the last line while editing this file if you want because it isn't used

# localhost 0 backuppc

6 - Now create the file /etc/backuppc/winserver.pl and add all options that are different from the ones in /etc/backuppc/config.pl

sudo nano /etc/backuppc/winserver.pl

$Conf{SmbShareName} = 'data';
$Conf{SmbShareUserName} = 'username';
$Conf{SmbSharePasswd} = 'password';
$Conf{XferMethod} = 'smb';

note that multiple shares can be backed up using the following syntax:

$Conf{SmbShareName} = ['share1', 'share2'];

7 - Restart BackupPC with the following command:

sudo /etc/init.d/backuppc restart

8 - Then if you reload the BackupPC web interface you should find 'winserver' in the list of clients

http://192.168.0.100/backuppc/

That's it. You can now start the backup manually or wait for the pre-defined schedule to start

Its worth reading /etc/backuppc/config.pl and /etc/backuppc/hosts where you will become familiar with all the configuration options, including how to define, how often and when BackupPC wakes up to back up the clients, when and how often it performs full or incremental backups, how many log files it should keep, etc. etc.