mirror of
https://github.com/deajan/obackup.git
synced 2024-11-12 19:03:42 +01:00
Fixed mysqldump error codes not honored
This commit is contained in:
parent
fcab617c0d
commit
b1c6aeb6fc
@ -5,10 +5,10 @@ PROGRAM="obackup"
|
||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
||||
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
||||
PROGRAM_VERSION=2.0-RC1
|
||||
PROGRAM_BUILD=2016071901
|
||||
PROGRAM_BUILD=2016071902
|
||||
IS_STABLE=yes
|
||||
|
||||
## FUNC_BUILD=2016071901
|
||||
## FUNC_BUILD=2016071902
|
||||
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||
|
||||
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||
@ -744,6 +744,8 @@ function WaitForTaskCompletion {
|
||||
local seconds_begin=$SECONDS # Seconds since the beginning of the script
|
||||
local exec_time=0 # Seconds since the beginning of this function
|
||||
|
||||
local retval=0 # return value of monitored pid process
|
||||
|
||||
while eval "$PROCESS_TEST_CMD" > /dev/null
|
||||
do
|
||||
Spinner
|
||||
@ -775,7 +777,7 @@ function WaitForTaskCompletion {
|
||||
sleep $SLEEP_TIME
|
||||
done
|
||||
wait $pid
|
||||
local retval=$?
|
||||
retval=$?
|
||||
Logger "${FUNCNAME[0]} ended for [$caller_name] with status $retval." "PARANOIA_DEBUG" #__WITH_PARANOIA_DEBUG
|
||||
return $retval
|
||||
}
|
||||
@ -794,6 +796,8 @@ function WaitForCompletion {
|
||||
local seconds_begin=$SECONDS # Seconds since the beginning of the script
|
||||
local exec_time=0 # Seconds since the beginning of this function
|
||||
|
||||
local retval=0 # return value of monitored pid process
|
||||
|
||||
while eval "$PROCESS_TEST_CMD" > /dev/null
|
||||
do
|
||||
Spinner
|
||||
@ -1951,6 +1955,8 @@ function _BackupDatabaseLocalToLocal {
|
||||
retval=$?
|
||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
||||
Logger "Error output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID)" "ERROR"
|
||||
# Dirty fix for mysqldump return code not honored
|
||||
retval=1
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
@ -1983,6 +1989,8 @@ function _BackupDatabaseLocalToRemote {
|
||||
retval=$?
|
||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
||||
Logger "Error output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID)" "ERROR"
|
||||
# Dirty fix for mysqldump return code not honored
|
||||
retval=1
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
@ -2014,6 +2022,8 @@ function _BackupDatabaseRemoteToLocal {
|
||||
retval=$?
|
||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
||||
Logger "Error output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID)" "ERROR"
|
||||
# Dirty fix for mysqldump return code not honored
|
||||
retval=1
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ PROGRAM="obackup"
|
||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
||||
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
||||
PROGRAM_VERSION=2.0-RC1
|
||||
PROGRAM_BUILD=2016071901
|
||||
PROGRAM_BUILD=2016071902
|
||||
IS_STABLE=yes
|
||||
|
||||
source "./ofunctions.sh"
|
||||
@ -707,6 +707,8 @@ function _BackupDatabaseLocalToLocal {
|
||||
retval=$?
|
||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
||||
Logger "Error output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID)" "ERROR"
|
||||
# Dirty fix for mysqldump return code not honored
|
||||
retval=1
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
@ -739,6 +741,8 @@ function _BackupDatabaseLocalToRemote {
|
||||
retval=$?
|
||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
||||
Logger "Error output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID)" "ERROR"
|
||||
# Dirty fix for mysqldump return code not honored
|
||||
retval=1
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
@ -770,6 +774,8 @@ function _BackupDatabaseRemoteToLocal {
|
||||
retval=$?
|
||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
||||
Logger "Error output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID)" "ERROR"
|
||||
# Dirty fix for mysqldump return code not honored
|
||||
retval=1
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
|
16
obackup.sh
16
obackup.sh
@ -5,10 +5,10 @@ PROGRAM="obackup"
|
||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
||||
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
||||
PROGRAM_VERSION=2.0-RC1
|
||||
PROGRAM_BUILD=2016071901
|
||||
PROGRAM_BUILD=2016071902
|
||||
IS_STABLE=yes
|
||||
|
||||
## FUNC_BUILD=2016071901
|
||||
## FUNC_BUILD=2016071902
|
||||
## BEGIN Generic functions for osync & obackup written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
|
||||
|
||||
## type -p does not work on platforms other than linux (bash). If if does not work, always assume output is not a zero exitcode
|
||||
@ -725,6 +725,8 @@ function WaitForTaskCompletion {
|
||||
local seconds_begin=$SECONDS # Seconds since the beginning of the script
|
||||
local exec_time=0 # Seconds since the beginning of this function
|
||||
|
||||
local retval=0 # return value of monitored pid process
|
||||
|
||||
while eval "$PROCESS_TEST_CMD" > /dev/null
|
||||
do
|
||||
Spinner
|
||||
@ -756,7 +758,7 @@ function WaitForTaskCompletion {
|
||||
sleep $SLEEP_TIME
|
||||
done
|
||||
wait $pid
|
||||
local retval=$?
|
||||
retval=$?
|
||||
return $retval
|
||||
}
|
||||
|
||||
@ -772,6 +774,8 @@ function WaitForCompletion {
|
||||
local seconds_begin=$SECONDS # Seconds since the beginning of the script
|
||||
local exec_time=0 # Seconds since the beginning of this function
|
||||
|
||||
local retval=0 # return value of monitored pid process
|
||||
|
||||
while eval "$PROCESS_TEST_CMD" > /dev/null
|
||||
do
|
||||
Spinner
|
||||
@ -1858,6 +1862,8 @@ function _BackupDatabaseLocalToLocal {
|
||||
retval=$?
|
||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
||||
Logger "Error output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID)" "ERROR"
|
||||
# Dirty fix for mysqldump return code not honored
|
||||
retval=1
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
@ -1889,6 +1895,8 @@ function _BackupDatabaseLocalToRemote {
|
||||
retval=$?
|
||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
||||
Logger "Error output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID)" "ERROR"
|
||||
# Dirty fix for mysqldump return code not honored
|
||||
retval=1
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
@ -1919,6 +1927,8 @@ function _BackupDatabaseRemoteToLocal {
|
||||
retval=$?
|
||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
||||
Logger "Error output:\n$(cat $RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID)" "ERROR"
|
||||
# Dirty fix for mysqldump return code not honored
|
||||
retval=1
|
||||
fi
|
||||
return $retval
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user