From 1822542da79ff97de06d7262dc990d539bfab972 Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 16 Jun 2013 13:54:20 +0200 Subject: [PATCH] Added some execution hook checks. --- host_backup.conf | 13 +++++++------ obackup.sh | 6 ++++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/host_backup.conf b/host_backup.conf index 7badb85..30ac6e8 100755 --- a/host_backup.conf +++ b/host_backup.conf @@ -5,11 +5,11 @@ ###### Config file rev 1606201301 ## Backup identification, any string you want -BACKUP_ID="your backup identification string (eg: hostname)" +BACKUP_ID="your backup name" ## General backup options -BACKUP_SQL=yes -BACKUP_FILES=yes +BACKUP_SQL=no +BACKUP_FILES=no ## Local storage paths LOCAL_SQL_STORAGE="/home/storage/backup/sql" @@ -80,10 +80,10 @@ HARD_MAX_EXEC_TIME_TOTAL=36000 ROTATE_BACKUPS=no ROTATE_COPIES=7 -## Commands will be run before and / or after backup execution (remote execution will only happen if REMOTE_BACKUP is set to yes). +## Commands that will be run before and / or after backup execution (remote execution will only happen if REMOTE_BACKUP is set to yes). Very usefull to initiate snapshots. ## Set max execution time to 0 if you want these commands not to get stopped, else set a value in seconds after which execution will be stopped. -LOCAL_RUN_BEFORE_CMD="du /var -csh" -LOCAL_RUN_AFTER_CMD="du /var/log -csh" +LOCAL_RUN_BEFORE_CMD="" +LOCAL_RUN_AFTER_CMD="" REMOTE_RUN_BEFORE_CMD="" REMOTE_RUN_AFTER_CMD="" @@ -91,3 +91,4 @@ REMOTE_RUN_AFTER_CMD="" MAX_EXEC_TIME_PER_CMD_BEFORE=0 MAX_EXEC_TIME_PER_CMD_AFTER=0 + diff --git a/obackup.sh b/obackup.sh index fbb2e86..8b96193 100755 --- a/obackup.sh +++ b/obackup.sh @@ -2,7 +2,7 @@ ###### Remote (or local) backup script for files & databases ###### (L) 2013 by Ozy de Jong (www.badministrateur.com) -OBACKUP_VERSION=1.83 #### Build 1606201302 +OBACKUP_VERSION=1.83 #### Build 1606201303 DEBUG=no SCRIPT_PID=$$ @@ -132,7 +132,7 @@ function SendAlert { CheckConnectivityRemoteHost CheckConnectivity3rdPartyHosts - cat $LOG_FILE | gzip -9 > /tmp/obackup_lastlog.gz + cat "$LOG_FILE" | gzip -9 > /tmp/obackup_lastlog.gz if type -p mutt > /dev/null 2>&1 then echo $MAIL_ALERT_MSG | $(which mutt) -x -s "Backup alert for $BACKUP_ID" $DESTINATION_MAILS -a /tmp/obackup_lastlog.gz @@ -967,8 +967,10 @@ then then DryRun else + OLD_IFS=$IFS RunBeforeHook Main + IFS=$OLD_IFS RunAfterHook fi CleanUp