Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

./ && echo "FTP was succesful" | sendmail

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.