I have a script that rsyncs and ends like this
rsync -azvh /dir -e ssh email@example.com:/ RESULT="$?" # check result of rsync db's if [ "$RESULT" != "0" ]; then echo -e "rsync exit Code:" $RESULT "\nFAILED to rsync backups" else echo "SUCCESSFULL rsync of backups" fi
I have just been asked to wrap it in an API but the API states that
1=success. How can I change the exit code to reflect this? Do I need to assign it a variable?