get returncode of subshell
backupninja contains the code
retcode=$? # ^^^^^^^^ we have a problem! we can't grab the return code "$?". grrr.
which means there is no way of handling errors from shell scripts. It is possible to get the returncode with bash from ${PIPESTATUS[0]}. See attached patch which gets the returncode, and adds a fatal error to the bufferfile in the case of a non 0 return (which is very handy for noticing when a shell script has failed). You may want to do more with this, as other logic may have been written because we couldn't get a returncode previously ?
(from redmine: created on 2014-10-29, blocks #11246 (closed))
Edited by Guillaume Subiron