Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a script running on my box that checks every 5 minutes to see if a certain time type was uploaded to a folder on my Ftp server. I would like for it to send an email when the transfer is successful. I've tried to set something up with postfix, but I can't find a way to put in an if statement to the ftp script, so I'm at a roadblock.

share|improve this question
up vote 1 down vote accepted

Assuming you have something like sendmail correctly configured, you don't even need to have the mail command in your script. Just do something like

./my_ftp_script.sh && echo "FTP was succesful" | sendmail you@yourdomain.com

Just make sure your script exits with a non 0 value on failure.

share|improve this answer
    
Thank you so much, I've got it now. – hey Sep 15 '13 at 3:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .