Skip to content

Instantly share code, notes, and snippets.

@sitemapxml
Forked from skarllot/bacula-dir.conf
Created March 28, 2024 23:35
Show Gist options
  • Save sitemapxml/c346ef1211b3635f06d987c75116a6ef to your computer and use it in GitHub Desktop.
Save sitemapxml/c346ef1211b3635f06d987c75116a6ef to your computer and use it in GitHub Desktop.
Bacula configuration to use sendEmail
. . .
Messages {
Name = Standard
mailcommand = "/usr/local/bin/sendEmail-backup \"[BACKUP] %t %e of %n %l\" \"%r\""
operatorcommand = "/usr/local/bin/sendEmail-backup \"[BACKUP] Intervention needed for %j\" \"%r\""
mail = backup-handlers@example.com = all, !skipped
operator = backup-operator@example.com = mount
console = all, !skipped, !saved
append = "/var/log/bacula/bacula.log" = all, !skipped
catalog = all
}
Messages {
Name = Daemon
mailcommand = "/usr/local/bin/sendEmail-backup \"[BACKUP] Alert message\" \"%r\""
mail = backup-handlers@example.com = all, !skipped
console = all, !skipped, !saved
append = "/var/log/bacula/bacula.log" = all, !skipped
}
. . .
#!/bin/bash
SMTP_SERVER=smtp.example.com
USER=smtpuser
PASSWORD=smtppassword
SENDER=backup@example.com
SUBJECT=$1
RECIPIENTS=$2
/usr/local/bin/sendEmail -q -s $SMTP_SERVER -xu $USER -xp $PASSWORD -f $SENDER -u $SUBJECT -t $RECIPIENTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment