Saturday, May 9, 2009

Trying out Midori and loving it

Firefox has been giving me hard times the last weeks with frequent lockups (albeit short ones) on Google Reader and screwups on YouTube (sound not playing, video garbled).
I've thought about Opera, but not too long. It's a good browser and all, but I was eager to try something new, something based on WebKit.
I searched for the available options and Midori came out on top since I only have GTK installed (and wasn't going to get Qt).

Midori is a GTK browser based on WebKit. I've been testing it these past couple of days and I must say, I'm growing quite fond of it.
It's fast and responsive, has a lot of great features and is quite simple to configure.
The sad thing is though, lots of sites have built-in checks to see if the browser you're using is capable of displaying their special feature correctly.
For example: I was surfing amazon.com and I wanted to take a look inside one of the books. I got redirected to a page that told me my browser wasn't capable of doing this. I realize these sites do this in order to ensure maximum compatibility for their users, but I really wanted to see if Midori could do this. So I switched the 'Identify as' to 'internet explorer', shuddered lightly and reloaded the page.
It worked perfectly. I'm probably going to set the 'report as' to Firefox as a default, just to keep it in the right circles.

Too bad this way Midori won't get the love it deserves in the browser stats.

Thursday, May 7, 2009

Blogging as a way of better understanding.

Reading documentation can be a real pain sometimes. 50 lines in, the mind can wander to other places. IM/Twitter/RSS feeds are calling... they're so much more fun to read than documentation.

I'm going to try to use this blog to make recaps of documentation I'm reading. By blogging (writing in general) and thus 'actively reading', I hope to be more efficient at reading docs.

I guess it's like studying, where I used to make summaries of all my courses. Those really helped me understanding what the course was about.

But I'm no longer in school and I've got web 2.0 now, I guess I'll try it this way.

Installing and configuring Bacula on Gentoo

The backup system I wrote at work has one major shortcoming. It can't write multiple volumes. Instead of extending it so it supports that, I've decided to install Bacula on the fileserver and let that handle the tape backups.

This blog post is a report of how I installed and configured Bacula on the server.
(I'm going to add to this post as I go, because I'll probably not be able to do this all in one day.)
It'll also be a small recap of the Bacula documentation as I go over it. Mostly for future reference in case I need to repeat this installation.

Installing

Well what can I say, it's Gentoo, so it was basicly just 'emerge bacula'.
I did however add this line to /etc/portage/package.use:
app-backup/bacula bacula-console sqlite3 readline
To have the (for my installation) correct options installed.

Configuring

Before actually configuring, knowing what to configure could help.
Reading up on the Quickstart documentation helped a lot here.
Bacula uses its own terminology:
  • FileSet: What files to backup
  • Client: Who to backup. This is the servers where the files are.
  • Schedule: When to backup
  • Pool: where does the backup go?
  • Volume: the actual tape. A collection of tapes is a pool.
In Gentoo, the Bacula configuration files go in: /etc/bacula/

First thing that needed to be done was to edit the bconsole.conf file.
There isn't really a lot there, the default seemed good.
Director {
Name = fileserver-dir
DIRport = 9101
address = fileserver
Password = "thepassword" # not really :)
}

Only thing I needed to change was the password. (The default is set to something crazy for security).


Next, edit the bacula-sd.conf file.
I have a Dell TL2000 so I needed to make an 'Autochanger' and a 'Device'.
Autochanger {
Name = Autochanger
Device = LTO-3
Changer Command = "/usr/libexec/bacula/mtx-changer %c %o %S %a %d"
Changer Device = /dev/sg5
}

Device {
Name = LTO-3
Media Type = LTO-3
Archive Device = /dev/st0
Changer Command = "/usr/libexec/bacula/mtx-changer %c %o %S %a %d"
Changer Device = /dev/sg5
}
With this configuration I ran the 'btape' tool and issued the 'test' command.
All tests successful.. yay!

Now, in the Director configuration file: bacula-dir.conf I had to make jobs/clients/etc...
There's a pretty nice default example in there, so it was just basicly editing of the examples to get it to work.

Some things you need to pay attention to:
  • making sure all the passwords are correct helps lots ;-)
  • Choose the correct storage, configure it in the bacula-sd.conf
  • restart the appropriate daemon when you've changed it's configuration file.
Labeling the tapes

The tapes I use in the TL-2000 library all have barcode stickers on them. It would be very convenient if I could use those names in bacula aswell. Fortunately, there are console commands for this:
label barcode
update slots
cleaning prefix
If afterwards tapes (volumes) need to be put in a different pool, use update volume to change the pool of the volume.

Creating the filesets


Filesets on my server are quite simple:

FileSet {
Name = "datadir"
Include {
Options {
signature = MD5
}
File = /data
}
}
For every folder you wish to backup.

Schedules

These define when a backup needs to run.
One of my schedules looks like this:

Schedule {
Name = "daily_4"
Run = Level=Full mon-fri at 4:00
}
Should be self-explanatory.

Jobs

These are the most important ones. They define what is backed up, how and when.
The one for the weekly backups looks like this:

Job {
Name = "weekday"
JobDefs = "DefaultJob"
Level = Full
FileSet = "dailyFiles"
Schedule = "daily_4"
Pool = "Default"
}
Where JobDefs is this:
JobDefs {
Name = "DefaultJob"
Type = Backup
Client = fileserver-fd
Storage = Tape
Messages = Standard
Priority = 10
Write Bootstrap = "%c_%n.bsr"
}

It's a very small configuration, but it will be enough for the kind of backups I want to take. Ofcourse this example isn't the only job/fileset/schedule I configured.

It's running in test right now, I'll update here with the results.