1

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.

2
  • by default every cron job sends email to that user check them with mail command
    – PKumar
    Apr 1, 2015 at 15:22
  • This posting has an extensive Q&A that explains how to watch cron.log in real time on-screen: askubuntu.com/questions/966194/…
    – SDsolar
    Oct 22, 2017 at 6:41

1 Answer 1

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

3
  • 2
    ...and can be extracted via grep CRON /var/log/syslog
    – waltinator
    Apr 1, 2015 at 15:47
  • I was looking for the location of the syslog Apr 1, 2015 at 21:01
  • Note that Ubuntu jammy for example has not a "/var/log/syslog" Jun 15, 2023 at 10:39

Not the answer you're looking for? Browse other questions tagged .