From 8ac0ac51a44dd666e51ca3cdf657cdcfde875d87 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Fri, 20 Oct 2006 00:41:22 +0000 Subject: [PATCH] kes Fix optional files in Makefile.in of src/filed that caused a syntax error when using no optional files. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3568 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/Makefile.in | 4 +- .../examples/reports/bacula_mail_summary.sh | 44 ++++++++--- bacula/projects | 79 +++++++++++++++++++ bacula/technotes-1.39 | 14 +++- 4 files changed, 127 insertions(+), 14 deletions(-) diff --git a/bacula/Makefile.in b/bacula/Makefile.in index e4a0562cdd..4187ecb951 100755 --- a/bacula/Makefile.in +++ b/bacula/Makefile.in @@ -19,8 +19,8 @@ dummy: # --client-only directories fd_subdirs = src scripts src/lib src/findlib src/filed \ - @READLINE_SRC@ src/console \ - @GNOME_DIR@ @TRAY_MONITOR_DIR@ @WX_DIR@ + @READLINE_SRC@ @GNOME_DIR@ @TRAY_MONITOR_DIR@ @WX_DIR@ \ + src/console # Non-client-only directores subdirs = src/cats @DIRD_DIR@ @STORED_DIR@ src/tools diff --git a/bacula/examples/reports/bacula_mail_summary.sh b/bacula/examples/reports/bacula_mail_summary.sh index 266bfd1e5a..901f2efc93 100755 --- a/bacula/examples/reports/bacula_mail_summary.sh +++ b/bacula/examples/reports/bacula_mail_summary.sh @@ -3,19 +3,37 @@ # 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 (ISP Farlep) # Contributed by Andrew J. Millar +# Patched by Andrey A. Yakovlev # 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) } @@ -28,20 +46,28 @@ awk -F\:\ 'BEGIN { /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 diff --git a/bacula/projects b/bacula/projects index 76c0e48a76..3da15a6a32 100644 --- a/bacula/projects +++ b/bacula/projects @@ -1074,3 +1074,82 @@ Item 1: Filesystemwatch triggered backup. 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 + 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 + 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] = ". + So one could compare against 'ctime' and/or 'mtime', but ONLY 'before' + or 'since'. diff --git a/bacula/technotes-1.39 b/bacula/technotes-1.39 index 04e87eb250..ce7172b952 100644 --- a/bacula/technotes-1.39 +++ b/bacula/technotes-1.39 @@ -2,9 +2,17 @@ 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. -- 2.39.5