how to make a php crontab silent
- by BandonRandon
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