mirror of
https://github.com/deajan/obackup.git
synced 2025-02-12 14:23:52 +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"
|
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
||||||
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
||||||
PROGRAM_VERSION=2.0-RC1
|
PROGRAM_VERSION=2.0-RC1
|
||||||
PROGRAM_BUILD=2016071901
|
PROGRAM_BUILD=2016071902
|
||||||
IS_STABLE=yes
|
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
|
## 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
|
## 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 seconds_begin=$SECONDS # Seconds since the beginning of the script
|
||||||
local exec_time=0 # Seconds since the beginning of this function
|
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
|
while eval "$PROCESS_TEST_CMD" > /dev/null
|
||||||
do
|
do
|
||||||
Spinner
|
Spinner
|
||||||
@ -775,7 +777,7 @@ function WaitForTaskCompletion {
|
|||||||
sleep $SLEEP_TIME
|
sleep $SLEEP_TIME
|
||||||
done
|
done
|
||||||
wait $pid
|
wait $pid
|
||||||
local retval=$?
|
retval=$?
|
||||||
Logger "${FUNCNAME[0]} ended for [$caller_name] with status $retval." "PARANOIA_DEBUG" #__WITH_PARANOIA_DEBUG
|
Logger "${FUNCNAME[0]} ended for [$caller_name] with status $retval." "PARANOIA_DEBUG" #__WITH_PARANOIA_DEBUG
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
@ -794,6 +796,8 @@ function WaitForCompletion {
|
|||||||
local seconds_begin=$SECONDS # Seconds since the beginning of the script
|
local seconds_begin=$SECONDS # Seconds since the beginning of the script
|
||||||
local exec_time=0 # Seconds since the beginning of this function
|
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
|
while eval "$PROCESS_TEST_CMD" > /dev/null
|
||||||
do
|
do
|
||||||
Spinner
|
Spinner
|
||||||
@ -1951,6 +1955,8 @@ function _BackupDatabaseLocalToLocal {
|
|||||||
retval=$?
|
retval=$?
|
||||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
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"
|
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
|
fi
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
@ -1983,6 +1989,8 @@ function _BackupDatabaseLocalToRemote {
|
|||||||
retval=$?
|
retval=$?
|
||||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
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"
|
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
|
fi
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
@ -2014,6 +2022,8 @@ function _BackupDatabaseRemoteToLocal {
|
|||||||
retval=$?
|
retval=$?
|
||||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
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"
|
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
|
fi
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@ PROGRAM="obackup"
|
|||||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
||||||
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
||||||
PROGRAM_VERSION=2.0-RC1
|
PROGRAM_VERSION=2.0-RC1
|
||||||
PROGRAM_BUILD=2016071901
|
PROGRAM_BUILD=2016071902
|
||||||
IS_STABLE=yes
|
IS_STABLE=yes
|
||||||
|
|
||||||
source "./ofunctions.sh"
|
source "./ofunctions.sh"
|
||||||
@ -707,6 +707,8 @@ function _BackupDatabaseLocalToLocal {
|
|||||||
retval=$?
|
retval=$?
|
||||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
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"
|
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
|
fi
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
@ -739,6 +741,8 @@ function _BackupDatabaseLocalToRemote {
|
|||||||
retval=$?
|
retval=$?
|
||||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
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"
|
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
|
fi
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
@ -770,6 +774,8 @@ function _BackupDatabaseRemoteToLocal {
|
|||||||
retval=$?
|
retval=$?
|
||||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
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"
|
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
|
fi
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
|
16
obackup.sh
16
obackup.sh
@ -5,10 +5,10 @@ PROGRAM="obackup"
|
|||||||
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
AUTHOR="(C) 2013-2016 by Orsiris de Jong"
|
||||||
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
CONTACT="http://www.netpower.fr/obackup - ozy@netpower.fr"
|
||||||
PROGRAM_VERSION=2.0-RC1
|
PROGRAM_VERSION=2.0-RC1
|
||||||
PROGRAM_BUILD=2016071901
|
PROGRAM_BUILD=2016071902
|
||||||
IS_STABLE=yes
|
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
|
## 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
|
## 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 seconds_begin=$SECONDS # Seconds since the beginning of the script
|
||||||
local exec_time=0 # Seconds since the beginning of this function
|
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
|
while eval "$PROCESS_TEST_CMD" > /dev/null
|
||||||
do
|
do
|
||||||
Spinner
|
Spinner
|
||||||
@ -756,7 +758,7 @@ function WaitForTaskCompletion {
|
|||||||
sleep $SLEEP_TIME
|
sleep $SLEEP_TIME
|
||||||
done
|
done
|
||||||
wait $pid
|
wait $pid
|
||||||
local retval=$?
|
retval=$?
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -772,6 +774,8 @@ function WaitForCompletion {
|
|||||||
local seconds_begin=$SECONDS # Seconds since the beginning of the script
|
local seconds_begin=$SECONDS # Seconds since the beginning of the script
|
||||||
local exec_time=0 # Seconds since the beginning of this function
|
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
|
while eval "$PROCESS_TEST_CMD" > /dev/null
|
||||||
do
|
do
|
||||||
Spinner
|
Spinner
|
||||||
@ -1858,6 +1862,8 @@ function _BackupDatabaseLocalToLocal {
|
|||||||
retval=$?
|
retval=$?
|
||||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
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"
|
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
|
fi
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
@ -1889,6 +1895,8 @@ function _BackupDatabaseLocalToRemote {
|
|||||||
retval=$?
|
retval=$?
|
||||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
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"
|
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
|
fi
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
@ -1919,6 +1927,8 @@ function _BackupDatabaseRemoteToLocal {
|
|||||||
retval=$?
|
retval=$?
|
||||||
if [ -s "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.error.$SCRIPT_PID" ]; then
|
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"
|
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
|
fi
|
||||||
return $retval
|
return $retval
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user