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

Posted by Scott in FreeBSD

2 Responses to “Bacula Message tweaks”

  1. Dan Langille Says:

    I prefer to get the emails each day, and I use procmail to put successful emails into a folder. The failed ones go straight to my inbox.

    NOTE: both your solution and my solution will not show you any warnings. Such warnings might be relevant.

  2. Scott Says:

    Dan, that’s a great point. I experienced exactly what you’re saying today when I realized bacula-dir hadn’t been running.

    The /usr/ports/UPDATING says there’s an upgrade script, and I went ahead and ran it (I think it was in /usr/local/share/bacula/update_mysql_tables.

    Maybe I should turn those emails back on, and do something similar to what you’re doing with the folders. I’m still learning the ins and outs of bacula – it seems like the 500 lb gorilla of backups.

Leave a Reply

 
  • 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...