Linux Server Diary

The trials and tribulations of a Linux newbie trying to setup a home server.

Friday, March 09, 2007

BackupPC #6 - Actual Backups Completed

When we last heard from our hero in part 5, he had finally figured out how to connect 2 Linux hosts together.

Since then, I've backed up the file server (22 hours), and 2 of the 3 desktop PCs. One problem that has not gone away is the fact that I can't connect to the other DHCP hosts. I tried modifying the DHCP Address Range parameter like this:
$Conf{DHCPAddressRanges} = [{ ipAddrBase => '192.168.254',first => 13, last => 253}];
But still no luck.

Just to get things going, I started the backups from the target machines so that the program would know where to look. Now that I've done this, I can start future jobs from the server or from my machine (assuming the DHCP assigned address doesn't change). I'm thinking it might be easier if I just use static IPs for the desktops!

Anyway, the backup of my daughter's machine, as well as my desktop, went great. My wife's is giving me a generic 'backup failed' error. I'm sure I'll figure it out.

The file server backup took 22 hours, but that was only on the 2nd try. The first was interrupted after 6 hours by a power outage here at the LSD Ranch. Apparently it starts from scratch after being interrupted.

Learn the exiting conclusion of this story in part 7.

Labels:

Wednesday, March 07, 2007

BackupPC #5 - Unlocking the Keys

In part 4, I still hadn't resolved the public/private key issue. The problem was that the scp command called for to move the public key from one server to another kept failing. I was typing in the correct password for root, but it wouldn't take it.

Just a couple of minutes ago, I had a 'DUH!' moment. Way back when I was configuring ssh, I disallowed login by root. Yet this was what I was trying to do. After changing that option back to Yes, it worked great.

The keys are merged, and the full backup of the file server has started. I have no idea how long it will take to backup around 50GB, but I'm not going to stay up to find out. Turn to part 6 for the answer.

Labels:

BackupPC #4 - Configuration Tweaks

While I wait for the desktop machine backup started in part 3 to finish (it's really taking a lot of processor time on the desktop machine), I was reading through the configuration file and decided to change a few things.

First, to limit when the backups run, I changed the wakeup schedule, which was originally set to once an hour, to only run at 2:00 AM.
$Conf{WakeupSchedule} = [2];
Next, I adjusted the number of simultaneous backups allowed so that I wouldn't overload the backup machine's old, slow processor.
$Conf{MaxBackups} = 2;
Finally, I noticed that files in the initial backup weren't compressed. I found that the compression level was set to 0, which means no compression. I changed it to the recommended value of 3.
$Conf{CompressLevel} = 3;
The docs say that a perl library called Compress::Zlib is required for compression to work. I'll have to see if it is loaded.

UPDATE: Apparently, the compression library is available, because a fresh full backup of the backup server achieved 73% compression. While that was running, I added two more desktops to the list. I'm going to refrain from starting the first backups manually, and instead let the auto job pick them up at 2:00. I'll check the status in the AM.

I found another tutorial on the Debian Help site that doesn't mention using public/private keys for rsync use. I'll give it a read and maybe try another configuration for the file server backup.

I can't wait until part 5!

Labels:

BackupPC #3 - Backing Up a Windows Machine

I'm going to take a break from the public/private key issues as described in part 2, and instead focus on backing up my Windows machine.

We keep all of our documents, photos, music, and other important files on the server, so I only need to backup machine specific things. In my case, I'm mainly interested in my Thunderbird address book. After a little digging around, I've decided to grab the Application Data and My Documents folders. I'm not looking at the entire Documents and Settings folder because I don't want to backup all of the temporary Internet files, nor will I include the Desktop folder, since it is where I store downloaded TV shows and other temporary things (that add up to lots of GBs and would fill up the backup server quickly).

As instructed on page 6 of our tutorial, I started by setting up a shared folder on the desktop machine. I added a line to /etc/backuppc/hosts for this machine, and this time I used a '1' in the 2nd column to indicate a DHCP assigned address.

Next, I created a configuration file for the desktop and copied the suggested lines from the tutorial and updated the information for my situation. I don't really like storing my password in text like that. I'll have to secure the file to keep prying eyes out.

I also included the following line to limit the backup to the two desired directories.
$Conf{BackupFilesOnly} = ['/Application Data', '/My Documents'];
I restarted the daemon, and then started the backup from the web page. It's going and seems to be OK.

In part #4, I'll return to the file server problems.

Labels:

But at Least the Email Works

This message arrived in my Inbox today:

Dear Dan,

Your PC (hostname) has never been successfully backed up by our
PC backup software. PC backups should occur automatically
when your PC is connected to the network. You should contact
computer support if:

- Your PC has been regularly connected to the network, meaning
there is some configuration or setup problem preventing
backups from occurring.

- You don't want your PC backed up and you want these email
messages to stop.

Otherwise, please make sure your PC is connected to the network
next time you are in the office.

Regards,
BackupPC Genie
http://backuppc.sourceforge.net

Labels:

Tuesday, March 06, 2007

BackupPC #2

In part 1, we left our hero with BackupPC installed but with nothing to back up. Or so he thought....

When I came downstairs this morning, I refreshed the BackupPC Server Status page, and found that the file pool now contained 928 files! From where? It seems that the default setup will backup the localhost machine. Now, this box only has a few hundred MB of files on it - Ubuntu and the BackupPC files. Apparently, a full backup was done during the night, and I was greeted with a successful backup status. That means it works!

Now it's time to setup the main file server for backup. I started tonight by adding the server to the hosts file - /etc/backuppc/hosts. I added the following line:
hostname 0 username
(You can insert your hostname and username instead of my italicized placeholders.)

And I used this command to setup the user in BackupPC:
htpasswd /etc/backuppc/htpasswd username
For this next part, I'm going to deviate a little from the instructions. The config.pl file is setup to backup localhost (as I learned this morning), and I don't want to change that. So instead, I will create a new config file for the file server. It will be called:
/etc/backuppc/hostname.pl
I only need to enter the settings that are different from the main config file. Here's what I came up with (sorry for the extra line breaks):

# BackupPC config file for hostname

# Set the file transfer method
$Conf{XferMethod} = 'rsync';

# Use $hostIP for the client path
$Conf{RsyncClientCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argList+';
$Conf{RsyncClientRestoreCmd} = '$sshPath -q -x -l root $hostIP $rsyncPath $argL$

# Name the partition
$Conf{RsyncShareName} = '/';

# Limit backup to the /export directory
$Conf{BackupFilesOnly} = '/export';

# Skip the music files and podcasts
$Conf{BackupFilesExclude} = ['/export/music', '/export/Podcasts'];
We'll see what happens.

After restarting the daemon, it's time to configure SSN and rsync. I followed the instructions on page 4 of the tutorial.

... 30 Minutes Later ...

I'm getting totally hosed on the public/private key stuff. I wonder if it is because I've already generated keys before for openssh access. I'm going to pack it in for the night, so stay tuned for part 3.

Labels:

Monday, March 05, 2007

BackupPC #1

I started the BackupPC installation tonight. As a guide, I'm using this tutorial from HowToForge.

Starting with the very first step, my installation is different than documented. The mail program, exim, is asking questions I don't know how to answer. I guessed that I should use a smarthost to send mail with no local delivery. I set the domain and SMTP machine to my domian and my hosting company's mail server respectively. We'll find out later if those choices were correct.

Also, the setup never asked for my workgroup name.

The web interface came up without incident.

I should have noticed earlier that the data is stored in /var/lib/backuppc, so I'm going to have to setup my 80GB drive with that path. I've been looking through the config docs to see if I can alter that path - and I think that I should be able to, since it refers to a variable called $topdir that references the path - but I can't find anything. ...... You know, I'm going to look a little more before using that default. Hold on...

... OK, so I'm glad I checked. I found a note on this page that tells us that the TOPDIR setting is in this file:

/usr/share/backuppc/lib/BackupPC/Lib.pm

I changed the setting to /backup, the path I set when I partitioned the drives.

I restarted the daemon with /etc/init.d/backuppc reload, and now the web interface won't come up.

Error: Unable to connect to BackupPC server

I moved the directories from /var/lib/backuppc to /backup and restarted the daemon, but no luck.

I know this is a newbie move, but sometimes all can be set straight by a quick reboot. (It's my years of Windows training that made me do it!)

That's enough for tonight. More soon in part 2.

Labels:

Sunday, March 04, 2007

The Usual Stuff

Like the last several times, I'm performing the basic server setup using Ubuntu 6.10 Server Edition. It's a good basis for what I'm doing. Like before, I'm:

Assigning a Static IP
Configuring the Repositories
Setting Up SSH
Performing Software Updates
Making SSH Configuration Changes

And configuring ntpdate as outlined here.

UPDATE: 30 minutes later, and these steps are done. That's all for tonight.

Labels:

Building the Backup Server

Well, it's been a week since I switched to the new server, and there have been no problems. I had backed up the contents to my desktop hard drive just before the switch, so I'm ready to re-purpose the old server. It's going to become the backup server for everything else.

[9 Track Tapes]Long time readers will remember that the server only has an 80GB hard drive (plus a 7GB for the OS). How can I use that to back up 72GB on the file server, plus other files from the desktops, let alone save room for future growth on the 250GB drive? Well, I can't - at least not forever. But, I have a plan to get started, and I'll upgrade when I have to.

First, I'm not going to backup music files or podcasts. I have some of the music on CDs at work, and the rest I don't really care about that much. If I lose that Ted Nugent album, I'll live. The podcast directory is a temp folder at best. I move the files from the server to my MP3 player, and I only listen once. Cutting those two folders saves 20GB off the top!

Second, the software, backuppc, uses a compression algorithm. I don't expect much savings on the JPGs, but there may be a little on the rest of the files (maybe 20GB down to 5GB).

From the desktop PCs, I only plan to backup important configuration files, such as Thunderbird profiles. Anything else should be saved on the server, and the family knows that.

I'm starting by installing Ubuntu 6.10 Server Edition. I'll run through most of the same steps used on the file server, except for the Samba stuff. (We'll see.)

I'll report back after the initial setup is done - before the backuppc work starts.

Labels: