how to make a php crontab silent
Posted
by
BandonRandon
on Server Fault
See other posts from Server Fault
or by BandonRandon
Published on 2010-12-23T21:32:58Z
Indexed on
2010/12/23
21:56 UTC
Read the original article
Hit count: 334
I set up a crontab in Cpanel to run every min. It's working great but I don't want an e-mail every min. I have a second cron tab that runs every day. I would like the responce of this tab. Is there a way to tell the crontab to be silent or only e-mail on error?
I have:
* * * * * php /home/public_html/folder/file.php 2>&1
The last bit 2>&1
I added because i thought it would make it silent.
From the Cpanel Docs:
You can have cron send an email everytime it runs a command. If you do not want an email to be sent for an individual cron job you can redirect the command's output to /dev/null like this: mycommand >/dev/null 2>&1
© Server Fault or respective owner