mirror of
https://github.com/deajan/obackup.git
synced 2024-11-12 19:03:42 +01:00
Added STOP_ON_CMD_ERROR function
This commit is contained in:
parent
712692a3a7
commit
3030716003
15
obackup.sh
15
obackup.sh
@ -3,7 +3,7 @@
|
||||
###### Remote (or local) backup script for files & databases
|
||||
###### (L) 2013 by Orsiris "Ozy" de Jong (www.netpower.fr)
|
||||
OBACKUP_VERSION=1.84preRC3
|
||||
OBACKUP_BUILD=1009201301
|
||||
OBACKUP_BUILD=1109201301
|
||||
|
||||
DEBUG=no
|
||||
SCRIPT_PID=$$
|
||||
@ -301,13 +301,19 @@ function RunLocalCommand
|
||||
then
|
||||
Log "Running command [$1] on local host succeded."
|
||||
else
|
||||
Log "Running command [$1] on local host failed."
|
||||
LogError "Running command [$1] on local host failed."
|
||||
fi
|
||||
|
||||
if [ $verbose -eq 1 ]
|
||||
then
|
||||
Log "Command output:\n$(cat /dev/shm/obackup_run_local_$SCRIPT_PID)"
|
||||
fi
|
||||
|
||||
if [ "$STOP_ON_CMD_ERROR" == "yes" ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
## Runs remote command $1 and waits for completition in $2 seconds
|
||||
@ -335,6 +341,11 @@ function RunRemoteCommand
|
||||
then
|
||||
Log "Command output:\n$(cat /dev/shm/obackup_run_remote_$SCRIPT_PID)"
|
||||
fi
|
||||
|
||||
if [ "$STOP_ON_CMD_ERROR" == "yes" ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
function RunBeforeHook
|
||||
|
Loading…
Reference in New Issue
Block a user