Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stopping mail from a script

Status
Not open for further replies.

jawon

Programmer
Feb 6, 2003
31
0
0
US
I have a script that contains something like the following in order to ftp in some files...

ftp << EndFTP
open thatserver
ascii
prompt
get newfile.log
close
EndFTP

I have it set to run daily in crontab and it works fine. However, I receive an email in my unix mailbox each time this script runs. It primarily just says &quot;interactive mode off&quot;. How can I stop from these emails getting sent?
 
Hi,

within crontab put something like this:

00 12 * * * /your script > /dev/null 2>&1

&quot;> /dev/null 2>&1&quot; this bits will stop cronjob sending any mail to you as it will forward to /dev/null.


dbase77
 
Cron mail you stdout/stderr that haven't been redirected.
Add redirections for your script in the crontab :

23 59 * * * /path/to/the_script > /path/to/the_log 2>&1

Jean Pierre.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top