Report database sizes.
authorValentin Vidic <Valentin.Vidic@CARNet.hr>
Fri, 11 Mar 2011 15:21:16 +0000 (16:21 +0100)
committerValentin Vidic <Valentin.Vidic@CARNet.hr>
Fri, 11 Mar 2011 15:21:16 +0000 (16:21 +0100)
debian/postinst

index a192ddc..6f7ca9c 100644 (file)
@@ -216,6 +216,20 @@ EOF
 
   df -h | $GPG >> $REQUEST_FILE
 
+# attachment: database sizes
+if [ -d /var/lib/mysql -o -d /var/lib/postgresql ]; then
+    cat >> $REQUEST_FILE <<EOF
+--$BOUNDARY
+Content-Type: text/plain
+Content-Transfer-Encoding: 7bit
+Content-Disposition: inline; filename="db.txt.gpg"
+
+EOF
+
+    du -sh /var/lib/mysql /var/lib/postgresql 2>/dev/null \
+    | $GPG >> $REQUEST_FILE
+fi
+
 # attachment: client config
 cat >> $REQUEST_FILE <<EOF
 --$BOUNDARY