The output() function. This line:
printf "%s\n" "${m}"
It will fail if there is no attached TTY, which will set the exit code to 1, which in turn
will trigger the cleanup() function notifying the engine that the backup failed. This
ironically happens when it should be writing "Done." and exiting after a
successful backup. Fix I used was to change it to:
printf "%s\n" "${m}" >> "${LOG}"
You can't assume attached TTY since a lot of people like me want to run this as part
of a pre/post script to an automated backup program.