Condition in script

Hi all,

I am writing a script (.sh) which takes backup of database, zip it ftp to remote server and finally mail me to notify. So far this all has been done, however, now I am looking to add notification over each step. Means if any step is failed, then I should get an email and if all goes well, then I should get a mail that step 1, 2 and 3 are done successfully.

example:

#!/bin/sh
#
# step 1
backup database 
if(step 1 = true){
   do nothing;
}
else{
  mail admin and stop further execution
}

#step 2
gzip database dump
if(step 2= true){
   do nothing;
}
else{
  mail admin and stop further execution
}

#step 3
ftp dump to remoteServer
if(step 3 = true){
   do nothing;
}
else{
  mail admin and stop further execution
}

#step 4
mail administrator that all steps GOOD.

Bye,
Viki.

you can check exit status of each command sequence

This post looks like an early design concept or a homework question?

Please post the existing working script, highlighting those checkpoints which need an additional email progress report.