catch if tmp dir cannot be removed
This commit is contained in:
parent
5254dba0bf
commit
7f2f054ebc
@ -11,7 +11,9 @@ trap trapExit 1 2 3 6
|
||||
cleanup () {
|
||||
# remove borg temp directory, if it exists
|
||||
if [ -d "${borgBaseDir}/tmp" ]; then
|
||||
rm -rf "${borgBaseDir}/tmp" > /dev/null 2>&1
|
||||
if ! rm -rf "${borgBaseDir}/tmp" > /dev/null 2>&1; then
|
||||
consoleError 9 "Script completed successfully but could not remove temporary directory at $borgBaseDir/tmp. Sorry to be messy."
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user