Solved

Crontab: Set to run every hour but runs every 15 minutes. Why?

Posted on 2012-03-16
14
735 Views
Last Modified: 2012-06-27
I have the following set in /etc/crontab

40 * * * * root wget -q -O - 'http://www.mydomain.info/script.php' >/dev/null

Open in new window

To me this command should run every hour at +40 minutes.

For some reason though it runs every 15 minutes.

Can anybody see why?
0
Comment
Question by:AdrianSmithUK
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
  • 3
14 Comments
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37728976
Comment deleted.

wmp
0
 

Author Comment

by:AdrianSmithUK
ID: 37728985
Dear woolmilkporc

That's not what you told me in this post - See accepted solution.

http://www.experts-exchange.com/OS/Linux/Q_26977577.html
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37728991
That's why I deleted my comment - I was totally on the wrong track - don't have much time at this very moment.
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37729016
Sorry again, I obviously confused root's crontab with the system crontab - I've been in a hurry.

Now that our meeting has been cancelled I'm back.

Your cron job should indeed run every 40 minutes. I don't see any obvious reason why it should do something else.

Maybe you should restart the cron daemon, just to be sure?
0
 
LVL 11

Expert Comment

by:legolasthehansy
ID: 37729030
Check as root - "crontab -l"
See if the changes you made reflect on the Cron.
0
 

Author Comment

by:AdrianSmithUK
ID: 37729031
Nice to have you back.

I had is set to:

0 * * * *

And it fired every 15 minutes from the hour. (10:00,  10:15 ...etc)

I changed it to

40 * * * *

Now it fires like this (11:40, 11:55 ...etc)
0
 

Author Comment

by:AdrianSmithUK
ID: 37729045
Dear legolasthehansy

[root ~]# crontab -l
[root ~]# 

Open in new window


I'm using Centos 6. When I run the command I get nothing.
0
 
LVL 11

Assisted Solution

by:legolasthehansy
legolasthehansy earned 250 total points
ID: 37729049
Strange!

Check Cron logs.
Recreate the cron by deleting the entries and restarting CRON and then re-entering it.
Check if another user is running the same script using cron.
0
 
LVL 68

Expert Comment

by:woolmilkporc
ID: 37729053
"crontab -l" would only work on root's crontab, not on /etc/crontab

Same confusion as mine before.

Did you recycle crond?
0
 

Author Comment

by:AdrianSmithUK
ID: 37729088
Dear legolasthehansy

I looked in /var/log/cron

There is only a record for the hourly cron jobs.

I have Plesk installed. Do you think it could be to blame?
0
 
LVL 68

Assisted Solution

by:woolmilkporc
woolmilkporc earned 250 total points
ID: 37729145
I once read a bug report saying that an empty line just above a job entry could inhbit the correct scheduling of the job.

Could this be the culprit here?
0
 
LVL 11

Expert Comment

by:legolasthehansy
ID: 37729147
Not sure if Plesk has a utility to setup CRON's. But it should still show up on the files.

If you know the users allowed to access this server,
can you do this,

crontab -l <username1> (This would list the CRON's setup by username1)

You can get the list of users in the server by doing a cat on /etc/passwd and get the list of recent logged in users using the 'last' command.
0
 

Accepted Solution

by:
AdrianSmithUK earned 0 total points
ID: 37729376
Chaps,

Thanks for your help.

I never found the solution to the original problem. I tried removing the spare lines, but still had the same problem.

I noticed that plesk runs a backup manager every 15 minutes which might be a clue.

Mar 16 13:16:01 sXXXXXXXX CROND[3453]: (root) CMD ([ -x /usr/local/psa/admin/sbin/backupmng ] && /usr/local/psa/admin/sbin/backupmng >/dev/null 2>&1)
Mar 16 13:31:01 sXXXXXXXX CROND[3453]: (root) CMD ([ -x /usr/local/psa/admin/sbin/backupmng ] && /usr/local/psa/admin/sbin/backupmng >/dev/null 2>&1)

Open in new window



In the end I gave up and I used the built in plesk feature.

http://myhosting.com/kb/How_to_Set_Up_Scheduled_Tasks_(Cron_Jobs)_in_Plesk_10

I couldn't get it to work though.

In the end I found the problem was that SSH access was switched off for the domain.

Here is the solution:

http://drupal.org/node/1192934
0
 

Author Closing Comment

by:AdrianSmithUK
ID: 37746272
Great Support!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses how to create an extensible mechanism for linked drop downs.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

630 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question