Linux Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsOperating SystemsLinux Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 22nd, 2012, 10:30 AM
storemike storemike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 158 storemike User rank is Lance Corporal (50 - 100 Reputation Level)storemike User rank is Lance Corporal (50 - 100 Reputation Level)storemike User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 10 h 15 sec
Reputation Power: 10
Unscheduled cron job running with no record

Hello,

I've been digging through the tubes and pipes of the internet to try to find an answer, but haven't had any luck.

My server is Ubuntu 10.04 64bit, fully up to date.

The problem is that a cron job is running when it's not scheduled to. It's supposed to run on the first of the month, but it's been running on the 20th as well.

The line for it in the root (and only) crontab is:
00 07 1 * * php -f /var/w...

All other cronjobs run at their assigned schedules.

I first checked the system/software date and hwclock to see how far out of sync they were. The hwclock was 5 days behind, so I set it using

hwclock --systohc

which corrected the hwclock, but that didn't help. The cron still ran on the wrong day. Interestingly, the date it ran was 5 days later than the (incorrect) date it ran on in the previous month, which was the 15th.

Also, there is no log of it running in /var/log/syslog. All other cronjobs are logged there, though. The job sends me a spreadsheet report, so I always have a record of when it runs. To make sure, I grepped all in /var/log to see if it turned up somewhere else - it didn't.


Thanks everyone. This is driving me nuts!

Mike

Reply With Quote
  #2  
Old March 22nd, 2012, 08:22 PM
Doug G Doug G is offline
Grumpier Old Moderator
Dev Shed God 19th Plane (14000 - 14499 posts)
 
Join Date: Jun 2003
Posts: 14,239 Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level)Doug G User rank is General 52nd Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 4 Weeks 15 h 22 m 8 sec
Reputation Power: 4445
I'd wrap the command in a script that also logs when the script started and ended (in my own logfile). Maybe that will give an idea of when the job is run.
__________________
======
Doug G
======
It is a truism of American politics that no man who can win an election deserves to. --Trevanian, from the novel Shibumi

Reply With Quote
  #3  
Old March 23rd, 2012, 06:36 AM
this213's Avatar
this213 this213 is offline
D'oh!
Dev Shed Newbie (0 - 499 posts)
 
Join Date: May 2004
Location: East Coast
Posts: 72 this213 User rank is Second Lieutenant (5000 - 10000 Reputation Level)this213 User rank is Second Lieutenant (5000 - 10000 Reputation Level)this213 User rank is Second Lieutenant (5000 - 10000 Reputation Level)this213 User rank is Second Lieutenant (5000 - 10000 Reputation Level)this213 User rank is Second Lieutenant (5000 - 10000 Reputation Level)this213 User rank is Second Lieutenant (5000 - 10000 Reputation Level)this213 User rank is Second Lieutenant (5000 - 10000 Reputation Level) 
Time spent in forums: 15 h 10 m 28 sec
Reputation Power: 72
If your clock isn't staying in sync, perhaps you should set the system to use ntp. Once you have the right time, you should restart your cron daemon.

There's nothing in cron that tells it to log anywhere (unless yours is configured otherwise). Logging is completely up to the called routines. That said, I'd look at wherever php is configured to log on your system. A lot of times it logs to the default apache logs, even when being run from the cli.

Reply With Quote
  #4  
Old March 23rd, 2012, 08:52 AM
storemike storemike is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 158 storemike User rank is Lance Corporal (50 - 100 Reputation Level)storemike User rank is Lance Corporal (50 - 100 Reputation Level)storemike User rank is Lance Corporal (50 - 100 Reputation Level) 
Time spent in forums: 1 Day 10 h 15 sec
Reputation Power: 10
thanks. All cron jobs are logged to syslog. I added some logging to this particular php script as well.

After I set the hwclock a few weeks ago, I restarted the cron daemon and figured that it would use the newly set time.

Guess I'll just have to watch that new log to see what shows up next month.

In the meantime, I'll get the server using ntp. Not sure why it isn't.

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsLinux Help > Unscheduled cron job running with no record

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap