Bacula Message tweaks

Bacula tweaks: stopping those “boy who cried wolf” emails

Bacula is an open source backup program that “…comes by night and sucks the vital essence from your computers”

To be totally open about it, Bacula was hard to configure and use.  It’s just overkill for what I’m doing here. It separates the file-writing piece from the directing piece and the storage piece.   It was hard for me to learn how to use the console app because of the terminology.

Anyway, it’s installed, and it does run each night, as evidenced by its daily emails telling me it ran. Hey, Scott, I ran your backups. Your backups, I ran them. I get three of these emails daily, and I don’t want them unless it’s failing.
Here’s how to configure it so it only notifies you if something’s wrong. (if you’re anything like me, you’d be more likely to pay attention to its emails when it does have something important to say).

1. Open the /usr/local/etc/bacula-dir.conf file in your favorite text editor. I use vim.

2. Navigate down, down down into the depths of the file, and find the “Messages” section. Note that the word “Messages” is listed in several places, and you’ll probably have to skip several of them to get to the right spot. In my file, it’s close to the bottom, around line 378.

On a default configuration, it looks something like this:

Messages {

Name = Daemon

mailcommand = “/usr/local/sbin/bsmtp -h localhost -f \”\(Bacula\) %r\” -s \”Bacula daemon message\” %r”

mail = root@localhost = all, !skipped

console = all, !skipped, !saved

append = “/var/db/bacula/log” = all, !skipped

}

3. The line you want to change is that “mail =” line. Not the mailcommand line, or any of the other dozens of lines that say mail, just the mail line.

4. Change that line to read “mail on error.”

5. I think there are two such lines in my file, so be sure and check yours also to ensure you’ve got them all. You’ll know by nighttime, or whenever your job runs whether we were successful.

Also check out:

The Bacula Messages Resource

Updating BIOS in FreeBSD (without Windows or a floppy drive)

I had strange happenings with the server, and figured a bios version upgrade might help out. After all, I was using a newer processor on an older motherboard, with newer ram. The BIOS version I had was A02, where the latest version was A10.

Most BIOS manufacturers provide free updates to patch their BIOS code. Unfortunately, often times these updates are:

  • Designed for Windows – i.e. they include “dummy” – type updaters for users who don’t know how to use a boot disk.
  • Designed for machines with floppy drives. Who uses floppy drives – what is this, 1985? Why not make me boot off punch cards or something?

Anyway, there are several ways around these two issues; like most modern low-level PC troubleshooting, a CD-based boot disk is involved.

Ingredients:

One DOS boot disk iso file – FreeDOS works pretty well. I used this one: http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/fdbasecd.iso but any of the iso-based ones ought to work OK.

One PC running your favorite OS, FreeBSD.

Working installation of cdrtools (installable from /usr/ports/sysutils/cdrtools). To check if you already have this, you can try typing “which mkisofs” on the FreeBSD command line. If you get a “Command not found,” you need to install it. If it comes back telling you where it’s located (e.g. /usr/local/bin/mkisofs, lucky you – you have it.

You’ll need the standalone executable for your BIOS upgrade… For my Dell, this was located on Dell’s support site. What you’re looking for is just the executable file that does the actual BIOS update. You may have to hunt around a little or find a way to extract the .exe from your manufacturer’s disk image. Some of the images available are self-extracting exes. Again, the one you want is just the executable dos-based updater.

Procedure:

What we want to do is edit the FreeDOS ISO image file to add the BIOS manufacturer’s executable file, then burn that new CD. Easy enough? You’d think so – but actually this is much easier on FreeBSD than you might think, and you don’t need expensive software to make it happen.

Here’s how:

Get your BIOS upgrade and your FreeDOS CD image (ISO) onto the FreeBSD computer.
I did this by using the fetch command, for example:
#fetch http://www.ibiblio.org/pub/micro/pc-stuff/freedos/files/distributions/1.0/fdbasecd.iso

Mount your FreeDOS ISO file: this will allow you to access all the FreeDOS files:
First, we need to create a device node in /dev

#mdconfig –a –t vnode –f iso_filename.iso –u 0

Next, we mount our newly created device:
#mount_cd9660 /dev/iso9660/FreeDOS\ 1.0 /mnt/freedos

Note that in the example above, I called the iso file iso_filename.iso, and mounted it to /mnt/freedos. You will of course have to create whatever directory you want to mount to ahead of time. No problem, right?

Great, so now, we can browse that ISO if we want to, just to check it out:

#cd /mnt/freedos
#ls

Now, I have an autorun.inf file, boot.catalog, freedos, isolinux, and setup.bat.
OK. One thing about our mounted ISO is it’s read-only, so in order to add more to it, we can just copy it to another directory (I used /tmp/bios_cd). Maybe there is a way to mount the ISO so it’s not read-only, but it seemed easier just to copy to a temporary location:

#cp –R /mnt/freedos /tmp/bios_cd

So now we can add our bios executable to the directory, create a new iso image, and burn it to disc.

#mkisofs -o /tmp/freedos_biosupdate.iso -q -l -N \

-boot-info-table -iso-level 4 -no-emul-boot \

-b isolinux/isolinux.bin \

-publisher “FreeDOS – www.freedos.org” \

-A “FreeDOS beta9 Distribution” -V FDOS_BETA9 -v .

Those commands will give us our new iso file, “/tmp/freedos_biosupdate.iso”
Note that the period at the end of the mkisofs command is required.

Pages that helped:

Mkisofs procedure graciously provided from this site: http://www.tummy.com/journals/entries/jafo_20080920_234755

Image mounting info for FreeBSD from here:
http://www.bsdguides.org/guides/freebsd/beginners/mdconfig_mount_images

This ended up working great, with one minor snag: as mentioned on the tummy.com page, I did have to escape out of the SETUP procedure for FreeDOS to avoid having it install FreeDOS as my OS on the hard drive. Why this is the default for FreeDOS, I have no idea. In retrospect, it may have been easier just to attach a floppy drive, but this worked out, and I didn’t have to order software.

 
  • jacob: Thanks for a great post. I had one issue with your command: #nice -n 10 portupgrade -aRr. you will get...
  • Pan: Do you have any problem printing from a windows machine? I have an Samsung ML1610 and I can print once from...
  • Scott: One other item. CUPS. To get this working right, I edited /usr/local/etc/cups/cupsd.conf , and added the line...
  • Scott: Follow-up item: after disabling nmbd as the Section 6 wiki mentioned, I found that I could no longer access...
  • Scott: Dan, that’s a great point. I experienced exactly what you’re saying today when I realized...