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:

April 6th, 2009 at 12:39 PM
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.
April 23rd, 2009 at 4:01 PM
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.