diff --git a/seafbackup.sh b/seafbackup.sh index 1c4a503..25724d7 100755 --- a/seafbackup.sh +++ b/seafbackup.sh @@ -83,6 +83,7 @@ cleanup () { fi } +# call cleanup and then exit with error report exitError () { printf "${err}[%s] -- [ERROR] %s: %s --${norm}\n" \ "$(stamp)" "$1" "$2" >> "$logFile" @@ -129,6 +130,7 @@ stamp () { (date +%F" "%T) } +# same as exitError but for signal captures trapExit () { printf "${err}[%s] -- [ERROR] 99: Caught signal --${norm}\n" \ "$(stamp)" >> "$logFile"