PDA

View Full Version : Quieten down the Lynx cron


myqee
10-23-2007, 01:13 PM
I've got the cron working on my setup using the lynx command:

lynx --source "http://xxxxxxxxx.com/xxxxxxxx/index.php/cron"

However, I'm getting the html source sent to the specified cron job email address every fifteen minutes. (I've set up the cron to run every 15 mins).

Is there anyway to stop these emails with a certain lynx parameter or something... and have only errors sent to the cron job email instead?

Thanks,
Mike

neenach2002
10-23-2007, 07:16 PM
There is always output - even when it doesn't fetch any emails from the inbox, and I'm unaware of any way to suppress output.

myqee
10-23-2007, 10:05 PM
Thanks for the info,... what do people normally do to stop the endless emails? ...put an incorrect one in to the cpanel cron manager?

Thanks

myqee
10-24-2007, 01:02 PM
Ok, I've given up trying to get lynx to stop sending the messages. I'm now using wget:

wget -O - --quiet "http://xxxxxxx.com/xxxxx/index.php/cron"

I was hoping the --quiet parameter would stop the emails but it doesn't.

Does wget have a parameter to stop the emails (whilst leaving error messages to get through)?

Thanks in advance.

neenach2002
10-24-2007, 06:32 PM
How about removing your email address from the cron setup?

myqee
10-24-2007, 08:50 PM
Will that not prevent me from being able to receive error emails though?

jstanden
10-25-2007, 12:12 AM
Hey guys,

The smart thing to do in this situation is to redirect any cron output to /dev/null.

You do that like this:

*/1 * * * * lynx --blah >/dev/null 2>&1


Those bold parts mean:


>/dev/null (redirect any screen output to null -- silently ignore/destroy it)
2>&1 (combine STDERR and STDOUT for the redirect so you get no screen output from either pipe. In some situations you'd want to only suppress output and still be emailed explicit errors from a shell script, so you'd leave this part off).

jstanden
10-25-2007, 12:16 AM
I added this to the KB as well:
http://www.cerberusweb.com/kb/article/000033