crontool
Paste a schedule, read it in English, see the next runs.

What 2>&1 Means in Cron

In a crontab line, >> file 2>&1 sends both normal output and error output to the same log file. 2>&1 means 'send stream 2 (stderr) to wherever stream 1 (stdout) is already going'.

The streams

Every command has two output channels: stdout (file descriptor 1, normal output) and stderr (file descriptor 2, errors). Cron mails whatever isn't redirected to the crontab owner.

What the line does

*/5 * * * * /path/job.sh >> /var/log/job.log 2>&1

>> /var/log/job.log appends stdout to the log. 2>&1 then says "stderr goes to the same place as stdout" — so errors land in the log too.

Order matters

Put 2>&1 after the file redirect. If you write 2>&1 >> file, stderr is duplicated to the terminal's stdout before stdout is pointed at the file, so errors won't be logged.

Throw output away

>/dev/null 2>&1 discards everything (and stops cron emails). Use this only when you're sure you don't need the output.

FAQ

What does 2>&1 mean in cron?

It redirects stderr (stream 2) to the same destination as stdout (stream 1), so both normal output and errors go to the same log file.

Why must 2>&1 come after the file redirect?

Redirections are read left to right. >> file 2>&1 points stdout at the file first, then sends stderr there too. Reversing the order logs only stdout.

What does >/dev/null 2>&1 do?

It discards all output, both stdout and stderr, and stops cron from emailing you the results. Use it only when you don't need any output.