# and send it to people who care.
#
# For it to work, you need to have all Bacula job report
-# mails cc'd to a unix mailbox called 'bacula', but of course you can edit
-# as appropriate. This should be run after all backup jobs have finished.
+# loggin to file, edit path for Your needs
+# This should be run after all backup jobs have finished.
# Tested with bacula-1.38.0
+# Some improvements by: Andrey Yakovlev <freedom@kiev.farlep.net> (ISP Farlep)
# Contributed by Andrew J. Millar <andrew@alphajuliet.org.uk>
+# Patched by Andrey A. Yakovlev <freedom@kiev.farlep.net>
# Use awk to create the report, pass to column to be
# formatted nicely, then on to mail to be sent to
# people who care.
-EMAIL_LIST="peoplewhocare@company.com"
+
+EMAIL_LIST="freedom@kiev.farlep.net"
+
+LOG='/var/db/bacula/log'
+
+
+#---------------------------------------------------------------------
+
awk -F\:\ 'BEGIN {
print "Client Status Type StartTime EndTime Files Bytes"
}
+
+ /orion-dir: New file:/ {
+ print $3
+ }
+
+ /orion-dir: File:/ {
+ print $3
+ }
+
/Client/ {
CLIENT=$2; sub(/"/, "", CLIENT) ; sub(/".*$/, "", CLIENT)
}
/End time/ {
ENDTIME=$2; sub(/.*-.*-.* /, "", ENDTIME)
}
+ /Files Examined/ {
+ SDFILES=$2
+ SDBYTES=0
+ }
/SD Files Written/ {
SDFILES=$2
}
- /SD Bytes Written/ {
+ /SD Bytes Written/ {
SDBYTES=$2
}
/Termination/ {
TERMINATION=$2 ;
sub(/Backup/, "", TERMINATION) ;
- printf "%s %s %s %s %s %s %s \n", CLIENT,TERMINATION,TYPE,STARTTIME,ENDTIME,SDFILES,SDBYTES}' /var/spool/mail/bacula | \
- column -t | \
- mail -s "Bacula Summary for `date -d yesterday +%a,\ %D`" ${EMAIL_LIST}
+ gsub(/\*\*\*/, "", TERMINATION) ;
+ sub(/Verify OK/, "OK-Verify", TERMINATION) ;
+ sub(/y[ ]/, "y-", TERMINATION) ;
+ printf "%s %s %s %s %s %s %s \n", CLIENT,TERMINATION,TYPE,STARTTIME,ENDTIME,SDFILES,SDBYTES}' ${LOG} | \
+ column -t -x | \
+ mail -s "Bacula Summary for `date -v -1d +'%a, %F'`" ${EMAIL_LIST}
#
-# Empty the mailbox
-cat /dev/null > /var/spool/mail/bacula
+# Empty the LOG
+cat ${LOG} > ${LOG}.old
+cat /dev/null > ${LOG}
#
# That's all folks
Notes: This can be combined with configration that specifies
something like: "at most every 15 minutes or when changes
consumed XX MB".
+
+Item n: Message mailing based on backup types
+Origin: Evan Kaufman <evan.kaufman@gmail.com>
+ Date: January 6, 2006
+Status:
+
+ What: In the "Messages" resource definitions, allowing messages
+ to be mailed based on the type (backup, restore, etc.) and level
+ (full, differential, etc) of job that created the originating
+ message(s).
+
+Why: It would, for example, allow someone's boss to be emailed
+ automatically only when a Full Backup job runs, so he can
+ retrieve the tapes for offsite storage, even if the IT dept.
+ doesn't (or can't) explicitly notify him. At the same time, his
+ mailbox wouldnt be filled by notifications of Verifies, Restores,
+ or Incremental/Differential Backups (which would likely be kept
+ onsite).
+
+Notes:
+ One way this could be done is through additional message types, for example:
+
+ Messages {
+ # email the boss only on full system backups
+ Mail = boss@mycompany.com = full, !incremental, !differential, !restore,
+ !verify, !admin
+ # email us only when something breaks
+ MailOnError = itdept@mycompany.com = all
+ }
+
+
+Item n: Allow inclusion/exclusion of files in a fileset by creation/mod times
+ Origin: Evan Kaufman <evan.kaufman@gmail.com>
+ Date: January 11, 2006
+ Status:
+
+ What: In the vein of the Wild and Regex directives in a Fileset's
+ Options, it would be helpful to allow a user to include or exclude
+ files and directories by creation or modification times.
+
+ You could factor the Exclude=yes|no option in much the same way it
+ affects the Wild and Regex directives. For example, you could exclude
+ all files modified before a certain date:
+
+ Options {
+ Exclude = yes
+ Modified Before = ####
+ }
+
+ Or you could exclude all files created/modified since a certain date:
+
+ Options {
+ Exclude = yes
+ Created Modified Since = ####
+ }
+
+ The format of the time/date could be done several ways, say the number
+ of seconds since the epoch:
+ 1137008553 = Jan 11 2006, 1:42:33PM # result of `date +%s`
+
+ Or a human readable date in a cryptic form:
+ 20060111134233 = Jan 11 2006, 1:42:33PM # YYYYMMDDhhmmss
+
+ Why: I imagine a feature like this could have many uses. It would
+ allow a user to do a full backup while excluding the base operating
+ system files, so if I installed a Linux snapshot from a CD yesterday,
+ I'll *exclude* all files modified *before* today. If I need to
+ recover the system, I use the CD I already have, plus the tape backup.
+ Or if, say, a Windows client is hit by a particularly corrosive
+ virus, and I need to *exclude* any files created/modified *since* the
+ time of infection.
+
+ Notes: Of course, this feature would work in concert with other
+ in/exclude rules, and wouldnt override them (or each other).
+
+ Notes: The directives I'd imagine would be along the lines of
+ "[Created] [Modified] [Before|Since] = <date>".
+ So one could compare against 'ctime' and/or 'mtime', but ONLY 'before'
+ or 'since'.
General:
-Version 1.39.24 released:
-12Oct06
-kes Apply the three patches from Richard Mortimer.
+20Oct06
+kes Fix optional files in Makefile.in of src/filed that caused
+ a syntax error when using no optional files.
+15Oct06
+lf Fix a cosmetic bug in filed.c that caused spurious OpenSSL error
+ messages; there is no reason to attempt to load a private key.
+ from master key files.
+
+Version 1.39.24 released:
+12Oct06
+kes Apply the three patches from Richard Mortimer.
bacula-reposition.patch, bacula-tape-reopen.patch, and
bacula-eod.patch. This corrects tape positioning on older devices,
and also a problem with btape.