I have 2 cron jobs that were running fine but now stopped running. I looked through my crontab and everything looks OK. How can I tell if these jobs are running? is there a place where cron stores errors? Where do I look for cron specific errors, or even a record of the cron jobs that ran prior.
Asked
Active
Viewed 6,011 times
1
-
by default every cron job sends email to that user check them with mail command – PKumar Apr 01 '15 at 15:22
-
This posting has an extensive Q&A that explains how to watch cron.log in real time on-screen: https://askubuntu.com/questions/966194/16-04-how-do-i-make-cron-create-cron-log-and-monitor-it-in-real-time?noredirect=1&lq=1 – SDsolar Oct 22 '17 at 06:41
1 Answers
4
Try directing the output to a log file. Just make sure that it exists and is writable by whatever user the cronjob is running as. (In my example, this would be cyphertite)
I also recommend running date somewhere at the beginning of your script so that you get the date in the log file.
0 15 * * * /home/andrew/daily-backup.sh >> /var/log/cyphertite.log
Additionally, cron logs are directed to /var/log/syslog if that helps

Andrew Meyer
- 1,487