Added some execution hook checks.

This commit is contained in:
deajan 2013-06-16 13:54:20 +02:00
parent 1e5fce7f52
commit 1822542da7
2 changed files with 11 additions and 8 deletions

View File

@ -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

View File

@ -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