How to View Crontab Logs

Yesterday, a synchronization task in crontab failed to execute. I’m not sure why it didn’t run — it seems like the task hung. I wanted to investigate what went wrong with crontab or where it got stuck.

1.  Linux
Check the /var/log/cron file. You can use

tail -f /var/log/cron

to monitor it.


2.  Unix
In the /var/spool/cron/tmp directory, there are tmp files named like croutXXX001864. Tail these files to see the currently running tasks.

Leave a Comment

Your email address will not be published.