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