LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-08-2012, 02:37 PM   #1
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 33

Rep: Reputation: 3
Configured Cron job executed every hour is instead executed every minute for 10m


Hello,

I found a strange anomaly where Cron jobs are being executed every minute monetarily for approximately 15 minutes instead of their scheduled time. I like to understand why? Are there any configuration parameters that I can modify to adjust this behavior? The Cron job should only be executed once at the assigned scheduled time regardless the exit status of the job. Any assistance would be greatly appreciated.

Best Regards
 
Old 05-08-2012, 08:13 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
For a start, show the cronjob entry, secondly double-check there are no other cron entries for that ie user (inc root) entries are usually in files under /var/spool/cron, but system cron jobs are in any of these under /etc
Code:
-rw-r--r--.  1 root root    541 Mar  4  2011 anacrontab
drwxr-xr-x.  2 root root   4096 Jan 11 15:28 cron.d
drwxr-xr-x.  2 root root   4096 Apr  4 15:19 cron.daily
-rw-r--r--.  1 root root      0 Mar  4  2011 cron.deny
drwxr-xr-x.  2 root root   4096 Jan 11 15:28 cron.hourly
drwxr-xr-x.  2 root root   4096 Jun  4  2011 cron.monthly
-rw-r--r--.  1 root root    537 Jan 11 15:33 crontab
drwxr-xr-x.  2 root root   4096 Jun  4  2011 cron.weekly
 
Old 05-13-2012, 05:28 AM   #3
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 33

Original Poster
Rep: Reputation: 3
Hello,

The specified cron job is in bold and run as root:

Code:
05:59:11:/etc> crontab -u root -l
OPENZ_PATH = /usr/local/share/bombshellz/openZ/OpenZ.php
0 * * * * /etc/webmin/bandwidth/rotate.pl
# 0-59 * * * * /usr/sbin/logwatch --service dmeventd
# 0-59 * * * * root /usr/sbin/logwatch --service dmeventd
# 0,5,10,15,20,25,30,35,40,45,50,55 * * * * root /usr/sbin/logwatch --service dmeventd
@daily /usr/sbin/logwatch #Daily Log summary
@daily /usr/bin/rkhunter --cronjob
@hourly /usr/local/bin/php /usr/local/share/bombshellz/openZ/Library/Services/CheckGCCTimedUsers.php  
* 0,5,10,15,20 * * * /usr/local/bin/php /usr/local/share/bombshellz/openZ/Library/Services/TimeCheck.php $OPENZ_PATH
@hourly /usr/local/bin/php /usr/local/share/bombshellz/openZ/Library/Services/CheckUsersV2.php $OPENZ_PATH
As you can see, the job is only declared once. Rummaging through directories, this is what I found:

Code:
05:59:11:/etc> ls /var/spool/cron
allow  lastrun  tabs
05:59:11:/etc> cat /var/spool/cron/lastrun/cron.daily
05:59:11:/etc> ls /var/spool/cron/tabs/
root  stiny0
05:59:11:/etc> ls cron.*
cron.allow

cron.d:
dmeventd  dmeventd.rpmsave  sysstat  vnstat

cron.daily:
0logwatch   logrotate          suse-do_mandb             suse.de-backup-rpmdb   suse.de-clean-tmp   suse.de-rkhunter
afick_cron  suse-clean_catman  suse.de-backup-rc.config  suse.de-check-battery  suse.de-cron-local

cron.hourly:

cron.monthly:

cron.weekly:
Ideas?
 
Old 05-13-2012, 08:17 AM   #4
rknichols
Senior Member
 
Registered: Aug 2009
Distribution: Rocky Linux
Posts: 4,780

Rep: Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212Reputation: 2212
Quote:
Originally Posted by markings View Post
Code:
* 0,5,10,15,20 * * * /usr/local/bin/php /usr/local/share/bombshellz/openZ/Library/Services/TimeCheck.php $OPENZ_PATH
You asked for the job to be run every minute (first field is "*") during the specified hours. Replace that first "*" with some number in the range 0..59 .
 
Old 05-13-2012, 05:43 PM   #5
markings
Member
 
Registered: Nov 2011
Location: Penn
Distribution: OpenSuSE 13.1
Posts: 33

Original Poster
Rep: Reputation: 3
Hello,

I'm not sure how I missed that when I was reading the cron syntax. Thanks for the Help.

Best Regards
 
  


Reply



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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Xwindow's program will not run when executed on boot or when executed remotely richman1234 Programming 2 10-08-2010 01:32 PM
Cron job issue - every hour works, but specific hour fails lunarleviathan Linux - Newbie 6 11-20-2009 12:19 AM
how can we know whether a Cron job has been executed or not ?? vikas027 Linux - Server 6 04-17-2009 01:49 PM
Cron jobs are not getting executed sharu99 Programming 17 11-04-2008 12:04 AM
Specific Crontab Job is not executed . Itsik Harel Linux - Server 1 03-11-2007 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:26 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration