*/5 * * * * /usr/local/bin/php somephpfile.php>> /dev/null 2>&1
What exactly does the dev/null 2 mean?
Server Fault is a question and answer site for system and network administrators. It only takes a minute to sign up.Sign up to join this community
2>&1 means "send stderr to stdout."
>>/dev/null means "append stdout to /dev/null," which is a way of hiding program output by sending it into
/dev/null, whose only purpose in life is to act like a black hole for data. (Strictly speaking, for
>>/dev/null is the same as
These rules are evaluated from right to left, so in combination they say, "hide everything output to stderr and stdout." A common mistake is to specify them in the reverse order, which will not hide the stderr output.
Also worth knowing: you can explicitly send both streams to
/dev/null by saying
1>/dev/null 2>/dev/null or
&>/dev/null rather than sending stderr to stdout and then sending stdout to