Log of cron.daily?

13,466

All cron jobs (in a Debian based system like Ubuntu) are logged in /var/log/syslog. You are looking for "CRON" in all caps, so first step is to do a case insensitive search:

grep -i cron /var/log/syslog

Next, syslog may only show the last 24 hours or less meaning you may not see the daily entry in there. Try searching old syslog files as well:

zgrep -i cron /var/log/syslog*

You should be able to narrow down the results even further using:

zgrep -i cron.daily /var/log/syslog*
Share:
13,466
am3
Author by

am3

Updated on July 24, 2022

Comments

  • am3
    am3 almost 2 years

    I have a couple of cron jobs in cron.daily which are supposed to execute daily. I know these tasks get executed as I can see the end result. For example: I'm doing a back-up of MySQL DB and I can see the back-up file. However, I cannot find the log for this.

    • I checked /var/log/syslog with a grep CRON /var/log/syslog command all I can find is php5 session clean cronjob(I don't really know what that is)

    Where can I find the log for cron.daily?

    • Amadan
      Amadan almost 9 years
      Mailed to root account, like all cron job output. If you want explicit logging, write to a log file in your code yourself.
    • am3
      am3 almost 9 years
      @Amadan The /var/mail directory is empty.
  • am3
    am3 almost 9 years
    Great.. thanks! This worked. The last command only gave me last 6 days. Does it display 6 days/week at a time?
  • Martin Konecny
    Martin Konecny almost 9 years
    Unfortunately all syslog files after 6 days are discarded. Take a look into /etc/logrotate.d/rsyslog to change this behaviour.
  • am3
    am3 almost 9 years
    Thanks. Now I can just change the rotate value to have more logs.
  • Martin Konecny
    Martin Konecny almost 9 years
    You can also change how often it rotates (weekly instead of daily) so that you have 7 weeks instead of 7 days.
  • fedorqui
    fedorqui almost 9 years
    Did it solve your problem, @AGM ? Since you're new here, please don't forget to mark the answer accepted if your problem is already solved. You can do it clicking on the check mark beside the answer to toggle it from hollow to green. See Help Center > Asking if you have any question!