Added disk space report option (adam kosmin suggestion)
authormicah <micah@758a04ac-41e6-0310-8a23-8373a73cc35d>
Fri, 6 Oct 2006 18:42:32 +0000 (18:42 +0000)
committermicah <micah@758a04ac-41e6-0310-8a23-8373a73cc35d>
Fri, 6 Oct 2006 18:42:32 +0000 (18:42 +0000)
removed sys vserver not running noise report (anarcat suggestion)

git-svn-id: http://code.autistici.org/svn/backupninja/trunk@434 758a04ac-41e6-0310-8a23-8373a73cc35d

ChangeLog
etc/backupninja.conf.in
handlers/sys
src/backupninja.in

index db0931d2931933e68d4b669ac40dab86fb61ae57..a0e21f2d6e196ecfca157c0c6afa0c3095467960 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -13,6 +13,7 @@ version 0.9.4 -- unreleased
         . Changed order of -s to mail for compatibility
         . fixed permission stat call so it uses the --format supported by
           coreutils (Closes: #382747)
+        . Added disk space report option (thanks Adam Kosmin)
     handler changes
        Added tar handler:
         . create tarballs
@@ -61,9 +62,10 @@ version 0.9.4 -- unreleased
           0.4.3 will integrate them)
         . Now forbid to (try to) include /.
        sys:
-        . Many more system checks were added, thanks to Petr Klíma
+        . Many more system checks were added, (thanks to Petr Klíma)
         . Added warning if no devices were found (thanks Ranier Zocholl)
-        . Enhanced debian package selections to include purged packages (Thanks Tom Hoover)
+        . Enhanced debian package selections to include purged packages (thanks Tom Hoover)
+        . Removed warning about vserver not running (thanks anarcat)
        ldap:
         . Compress now happens in-line to save some disk space (Closes: #370778)
        makecd:
index f749e2ad76a813901b5a3e0e4878a293761e58ce..951a8ca5153e482f58fc2b7cbd5c5606c65ecafb 100644 (file)
@@ -25,6 +25,10 @@ reportsuccess = yes
 # even if there was no error. (default = yes)
 reportwarning = yes
 
+# if set to 'yes', disk space usage will be included in
+# the backup email report
+reportspace = no
+
 # set to the administration group that is allowed to 
 # read/write configuration files in /etc/backup.d
 admingroup = root
index 3c04365722c6d8d20901391b6f6642571bf7f840..8059866cea70affe63b32cbc88f9a64b44614fa4 100755 (executable)
@@ -93,7 +93,6 @@ if [ "$packages" == "yes" ]; then
                               nodpkg="$nodpkg|$vserver"
                            fi
                        else
-                           warning "vserver $vserver is not running, skipping installed packages report."
                            nodpkg="$nodpkg|$vserver"
                        fi
 
index 114d66c2faef86fb13967ecaf9ea97c259cc80fe..3bf0ad161e4ab7896d2ad6f504d7c48bd7787c42 100755 (executable)
@@ -426,6 +426,7 @@ setfile $conffile
 getconf configdirectory @CFGDIR@/backup.d
 getconf scriptdirectory @datadir@
 getconf reportemail
+getconf reportspace
 getconf reportsuccess yes
 getconf reportwarning yes
 getconf loglevel 3
@@ -526,6 +527,17 @@ if [ $doit == 1 ]; then
                        echo ${messages[$i]}
                done
                echo -e "$errormsg"
+               if [ "$reportspace" == "yes" ]; then
+                       previous=""
+                       for i in $(ls "$configdirectory"); do
+                       backuploc=$(grep ^directory "$configdirectory"/"$i" | awk '{print $3}')
+                       if [ "$backuploc" != "$previous" ]; then
+                               mountdev=$(mount | grep "$backuploc" | awk '{print $1}')
+                               df -h "$mountdev"
+                               previous="$backuploc"
+                               fi
+                       done
+               fi
        } | mail -s "backupninja: $hostname $subject" $reportemail
 fi