shell script email notification upon success or failure
I'm writing a shell script that basically transfers data files through SFTP to a database server and then invokes a pl/sql procedure which loads the data from those files (external tables) into internal database tables.

I've been doing some research on effective exception handling in shell scripts and it appears the `set -e` option can be used to terminate a script with an error whenever any command in the script runs which returns a non-zero exitcode.

So, my plan is to have a script which contains all of the processing that needs to get done (SFTP, moving/deleting files, calling pl/sql procedure, etc...) and to include `set -e` at the top of the script.  I also plan to redirect output to a log file in this script.

Then, I plan to have another script that calls the main processing script and then emails the log that gets produced with either a "Success" or "Failure" indicator in the subject of the email.

Are there any "gotchas" that any of you can foresee in this approach or does this seem reasonable?
shell script email notification upon success or failure
===

I'm writing a shell script that basically transfers data files through SFTP to a database server and then invokes a pl/sql procedure which loads the data from those files (external tables) into internal database tables.

I've been doing some research on effective exception handling in shell scripts and it appears the `set -e` option can be used to terminate a script with an error whenever any command in the script runs which returns a non-zero exitcode.

So, my plan is to have a script which contains all of the processing that needs to get done (SFTP, moving/deleting files, calling pl/sql procedure, etc...) and to include `set -e` at the top of the script.  I also plan to redirect output to a log file in this script.

Then, I plan to have another script that calls the main processing script and then emails the log that gets produced with either a "Success" or "Failure" indicator in the subject of the email.

Are there any "gotchas" that any of you can foresee in this approach or does this seem reasonable?