diff --git a/mysql_backup.sh b/mysql_backup.sh index 399c902..fb230bc 100755 --- a/mysql_backup.sh +++ b/mysql_backup.sh @@ -127,7 +127,7 @@ if [ -s ${pidfile} ] ; then exit 1 ; fi -trap "rm -f ${pidfile} ;" EXIT INT KILL TERM SIGKILL SIGTERM SIGHUP; +trap "rm -f ${pidfile} ;" EXIT INT KILL TERM SIGKILL SIGTERM SIGHUP ERR ; echo $$ > ${pidfile} ; @@ -173,6 +173,4 @@ if [ ! "${quiet}" ] ; then echo "Dump completed (`date +\"%H:%M:%S\"`)..." ; fi -rm -f ${pidfile} ; - -exit 0 ; \ No newline at end of file +rm -f ${pidfile} ; \ No newline at end of file