mirror of
https://github.com/deajan/obackup.git
synced 2025-05-10 20:23:41 +02:00
Added some execution hook checks.
This commit is contained in:
parent
1e5fce7f52
commit
1822542da7
@ -5,11 +5,11 @@
|
|||||||
###### Config file rev 1606201301
|
###### Config file rev 1606201301
|
||||||
|
|
||||||
## Backup identification, any string you want
|
## Backup identification, any string you want
|
||||||
BACKUP_ID="your backup identification string (eg: hostname)"
|
BACKUP_ID="your backup name"
|
||||||
|
|
||||||
## General backup options
|
## General backup options
|
||||||
BACKUP_SQL=yes
|
BACKUP_SQL=no
|
||||||
BACKUP_FILES=yes
|
BACKUP_FILES=no
|
||||||
|
|
||||||
## Local storage paths
|
## Local storage paths
|
||||||
LOCAL_SQL_STORAGE="/home/storage/backup/sql"
|
LOCAL_SQL_STORAGE="/home/storage/backup/sql"
|
||||||
@ -80,10 +80,10 @@ HARD_MAX_EXEC_TIME_TOTAL=36000
|
|||||||
ROTATE_BACKUPS=no
|
ROTATE_BACKUPS=no
|
||||||
ROTATE_COPIES=7
|
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.
|
## 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_BEFORE_CMD=""
|
||||||
LOCAL_RUN_AFTER_CMD="du /var/log -csh"
|
LOCAL_RUN_AFTER_CMD=""
|
||||||
|
|
||||||
REMOTE_RUN_BEFORE_CMD=""
|
REMOTE_RUN_BEFORE_CMD=""
|
||||||
REMOTE_RUN_AFTER_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_BEFORE=0
|
||||||
MAX_EXEC_TIME_PER_CMD_AFTER=0
|
MAX_EXEC_TIME_PER_CMD_AFTER=0
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
###### Remote (or local) backup script for files & databases
|
###### Remote (or local) backup script for files & databases
|
||||||
###### (L) 2013 by Ozy de Jong (www.badministrateur.com)
|
###### (L) 2013 by Ozy de Jong (www.badministrateur.com)
|
||||||
OBACKUP_VERSION=1.83 #### Build 1606201302
|
OBACKUP_VERSION=1.83 #### Build 1606201303
|
||||||
|
|
||||||
DEBUG=no
|
DEBUG=no
|
||||||
SCRIPT_PID=$$
|
SCRIPT_PID=$$
|
||||||
@ -132,7 +132,7 @@ function SendAlert
|
|||||||
{
|
{
|
||||||
CheckConnectivityRemoteHost
|
CheckConnectivityRemoteHost
|
||||||
CheckConnectivity3rdPartyHosts
|
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
|
if type -p mutt > /dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo $MAIL_ALERT_MSG | $(which mutt) -x -s "Backup alert for $BACKUP_ID" $DESTINATION_MAILS -a /tmp/obackup_lastlog.gz
|
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
|
then
|
||||||
DryRun
|
DryRun
|
||||||
else
|
else
|
||||||
|
OLD_IFS=$IFS
|
||||||
RunBeforeHook
|
RunBeforeHook
|
||||||
Main
|
Main
|
||||||
|
IFS=$OLD_IFS
|
||||||
RunAfterHook
|
RunAfterHook
|
||||||
fi
|
fi
|
||||||
CleanUp
|
CleanUp
|
||||||
|
Loading…
Reference in New Issue
Block a user