1
0
mirror of https://github.com/deajan/obackup.git synced 2024-12-26 07:23:41 +01:00

Added bash test

This commit is contained in:
deajan 2016-08-17 13:44:14 +02:00
parent 2658730f70
commit a4038750a7

View File

@ -3,11 +3,16 @@ SUBPROGRAM=[prgname]
PROGRAM="$SUBPROGRAM-batch" # Batch program to run osync / obackup instances sequentially and rerun failed ones PROGRAM="$SUBPROGRAM-batch" # Batch program to run osync / obackup instances sequentially and rerun failed ones
AUTHOR="(L) 2013-2016 by Orsiris de Jong" AUTHOR="(L) 2013-2016 by Orsiris de Jong"
CONTACT="http://www.netpower.fr - ozy@netpower.fr" CONTACT="http://www.netpower.fr - ozy@netpower.fr"
PROGRAM_BUILD=2016081703 PROGRAM_BUILD=2016081704
## Runs an osync /obackup instance for every conf file found ## Runs an osync /obackup instance for every conf file found
## If an instance fails, run it again if time permits ## If an instance fails, run it again if time permits
if ! type "$BASH" > /dev/null; then
echo "Please run this script only with bash shell. Tested on bash >= 3.2"
exit 127
fi
## Configuration file path. The path where all the osync / obackup conf files are, usually /etc/osync or /etc/obackup ## Configuration file path. The path where all the osync / obackup conf files are, usually /etc/osync or /etc/obackup
CONF_FILE_PATH=/etc/$SUBPROGRAM CONF_FILE_PATH=/etc/$SUBPROGRAM
@ -110,7 +115,7 @@ function Batch {
wait $! wait $!
result=$? result=$?
if [ $result != 0 ]; then if [ $result != 0 ]; then
if [ $result == 1 ] || [ $result == 120 ] || [ $result == 128 ]; then if [ $result == 1 ] || [ $result == 128 ]; then # Do not handle exit code 127 because it is already handled here
Logger "Run instance $(basename $confFile) failed with exit code [$result]." "ERROR" Logger "Run instance $(basename $confFile) failed with exit code [$result]." "ERROR"
if [ "$runAgainList" == "" ]; then if [ "$runAgainList" == "" ]; then
runAgainList="$confFile" runAgainList="$confFile"