0

Server: CentOS 5.2 with Logwatch 7.3-8.el5

I have a cronjob setup to run logwatch at 10:45pm daily. The cron runs and I get the logwatch email, but it's running at 4:30am. My server's time is behind by 30mins but that doesn't explain the hours delay.

crontab -e shows:

45 22 * * * /usr/sbin/logwatch

I do have other cronjobs but logwatch is the first, all others are after it at 1am, 2am, 4am, 5am and 5:05am.

Any ideas why the time is well out? Thanks

user69904
  • 231
  • 3
  • 12

2 Answers2

1

Although it does look like the crontab is set to start running at 22.45- I am assuming that you only get the email when this process has completed. So therefore, either the process is taking a long time to complete- or the email is getting held up somewhere (either on the server itself, or your isp/mail provider)

AliGibbs
  • 2,323
  • 21
  • 34
1

I don't know why it is not running at 22:45 but I have an idea why it's running at 4:30. Try to check if you don't have any logwatch script in /etc/cron.daily and then open /etc/crontab and look for line with cron.daily when it's running.

panaroik
  • 832
  • 5
  • 12
  • 1
    Also check /var/log/cron (or similar) for any indication of another logwatch scheduled task (probably one installed by the package itself). – Coops Feb 14 '11 at 11:43
  • In /etc/cron.daily/ there is: 0logwatch -> /usr/share/logwatch/scripts/logwatch.pl. Checked /var/log/cron and I can see logwatch at 10:45pm. Logwatch only takes a few seconds to run manually. In /etc/crontab I can see cron.daily set at 4:02am which matches up with the time. I still don't know why it's not running at 10:45 though. – user69904 Feb 14 '11 at 16:13
  • Try to remove logwatch0 script from /etc/cron.daily and focus on crontab entry at 22:45 if it's running or not. You wrote that 22:45 it's in log. I have to ask, did you enter proper path to logwatch binary in your cronjob? Also try to change your cronjob from "45 22 * * * /usr/sbin/logwatch" to "45 22 * * * /path/to/logwatch0_script" (copy that script somewhere and run it with your cronjob). – panaroik Feb 14 '11 at 21:14