From: Thierry Parmentelat <thierry.parmentelat@sophia.inria.fr>
Date: Mon, 5 Mar 2007 12:38:47 +0000 (+0000)
Subject: dumps and cleans the drupal database as well
X-Git-Tag: myplc-4.0-15~99
X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=c6d0216067f98de62a6590363a120d635ae34daf;p=myplc.git

dumps and cleans the drupal database as well
---

diff --git a/plc.d/db b/plc.d/db
index d018893..5bf4784 100755
--- a/plc.d/db
+++ b/plc.d/db
@@ -7,7 +7,7 @@
 # Mark Huang <mlhuang@cs.princeton.edu>
 # Copyright (C) 2006 The Trustees of Princeton University
 #
-# $Id$
+# $Id: db,v 1.7 2007/01/31 19:53:20 mlhuang Exp $
 #
 
 # Source function library and configuration
@@ -51,12 +51,15 @@ function dump_db()
     dump=/var/lib/pgsql/backups/$(date +"$PLC_DB_NAME.%Y-%m-%d-%H-%M.sql")
     pg_dump -U $PLC_DB_USER $PLC_DB_NAME > $dump
     check
+    dump=/var/lib/pgsql/backups/$(date +"drupal.%Y-%m-%d-%H-%M.sql")
+    pg_dump -U $PLC_DB_USER drupal > $dump
+    check
 }
 
 # Clean up old backups
 function clean_dumps()
 {
-    find /var/lib/pgsql/backups -name "$PLC_DB_NAME.*.sql" -atime +15 | xargs rm -f
+    find /var/lib/pgsql/backups '(' -name "$PLC_DB_NAME.*.sql" -o -name "drupal.*.sql" ')' -a -atime +15 | xargs rm -f
     check
 }
 
@@ -101,7 +104,7 @@ EOF
 	;;
 
     dump)
-      	MESSAGE=$"Dumping the database"
+      	MESSAGE=$"Dumping the databases in /var/lib/pgsql/backups"
 	dialog "$MESSAGE"
 
 	dump_db