I wanted to post this here in case anyone else can benefit from my experience.
We recently began doing Veeam backups/replicas of a Red Hat 6 server that requires freeze/thaw scripts because of a database application that it hosts.
We created the scripts referencing the documentation (http://helpcenter.veeam.com/backup/80/v ... ts_vm.html
), but they would always show as 'Error: Script finished execution with unexpected exit code: 1' in the Veeam UI. This would happen even with all but the most basic commands in the script, when hard-coding a successful exit-code (exit 0) and even when our own logging indicated that the script was executing successfully. Each time this occurred, we would also see '[ScriptInvoker] Exception thrown during script execution (SSH).' in the VM's "task log".
After much troubleshooting and with the assistance of Chris Vollentine from Veeam Support (case#: 00964208), we were able to determine that if the script, or any commands in it, generate any output back to Veeam, it will be interpreted as a false-failure. We were able to get things working by making sure any/all commands in our script redirected all output to /dev/null (> /dev/null 2>&1 &).
With this in place, the scripts would execute successfully and report as such in the UI.