In the Linux world we all love using Cron for lot’s of different background / scheduled tasks, since Cron jobs are not in foreground it’s really hard to debug them.

The easiest way is simply to send all STDOUT and STDERR to Syslog

* * * * * echo "test message" 2>&1 |logger

If you want to debug your bash script just add debug mode to the beginning of your script

set -x

To ensure your jobs are executed tail onĀ /var/log/cron

tail -f /var/log/cron

To see all the outputs in Syslog

tail -f /var/log/messages

Lahav Savir

Founder and CTO, Cloud Platforms

Read more posts by Lahav Savir