don't backup the huge monitor db
authorThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 15 Dec 2015 10:09:27 +0000 (11:09 +0100)
committerThierry Parmentelat <thierry.parmentelat@inria.fr>
Tue, 15 Dec 2015 10:09:27 +0000 (11:09 +0100)
scripts/ple-backup-cleanup.cron

index bb7a89f..289e47f 100755 (executable)
@@ -42,8 +42,17 @@ function backup_all_dbs {
        DBNAME=$(echo $i | cut -d '|' -f 1)
        DBUSER=$(echo $i | cut -d '|' -f 2)
        case $DBNAME in 
        DBNAME=$(echo $i | cut -d '|' -f 1)
        DBUSER=$(echo $i | cut -d '|' -f 2)
        case $DBNAME in 
-           template*[01]) ;;
-           *) backup_db $1 $2 $3 $DBNAME $DBUSER
+           template*[01])
+               ;;
+           monitor)
+               # only once every third day; this has reached the 10Bg mark already !
+               #(( $(date +%d) % 3 )) || backup_db $1 $2 $3 $DBNAME $DBUSER ;;
+               # Thierry - dec 2015 - skip this one entirely
+               # too big and not really interesting
+               ;;
+           *)
+               backup_db $1 $2 $3 $DBNAME $DBUSER
+               ;;
        esac
     done
 }
        esac
     done
 }
@@ -89,7 +98,7 @@ function backup () {
     echo "Please do not change this script directly, use git and related makefile at"
     echo "but http://git.onelab.eu/?p=infrastructure.git;a=blob;f=scripts/ple-backup-cleanup.cron"
     # postgresql
     echo "Please do not change this script directly, use git and related makefile at"
     echo "but http://git.onelab.eu/?p=infrastructure.git;a=blob;f=scripts/ple-backup-cleanup.cron"
     # postgresql
-    ps -C postmaster >& /dev/null && backup_all_dbs $BACKUP_DIR $HOST $DATE \
+    ps -C postmaster >& /dev/null || ps -C postgres >& /dev/null && backup_all_dbs $BACKUP_DIR $HOST $DATE \
        || echo "No postgresql database to backup on $HOST"
     # ejabberd
     type -p ejabberdctl >& /dev/null && backup_ejabberd $BACKUP_DIR $DATE \
        || echo "No postgresql database to backup on $HOST"
     # ejabberd
     type -p ejabberdctl >& /dev/null && backup_ejabberd $BACKUP_DIR $DATE \