View Single Post
Old 7th March 2013, 00:51
Shine Shine is offline
Junior Member
Join Date: Mar 2013
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default What is the usefulness of /dev/null 2>&1 in Cron?

For instance,
if I have a .pl script, or .php script, I could simply execute on my terminal
]# php /path/to/my/script.php
and make the code executed.

So, adding a cron job to run every 5 minutes for this script, can be written like this:
5 * * * * php /path/to/my/script.php
And the question is:
what is the difference between that statement, and, say:
5 * * * * /usr/bin/php /path/to/my/script.php > /dev/null 2>&1
I've searched the web for a detailed explanation but, I cannot find anything.
Would you explain me this please?
Or show me a page with this issue.

Thanks a lot.

Last edited by Shine; 7th March 2013 at 00:52. Reason: bad typing
Reply With Quote
Sponsored Links