Avatar of AdrianSmithUK
AdrianSmithUK
 asked on

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

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?
LinuxApache Web ServerPHP

Avatar of undefined
Last Comment
AdrianSmithUK

8/22/2022 - Mon
woolmilkporc

Comment deleted.

wmp
AdrianSmithUK

ASKER
Dear woolmilkporc

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

https://www.experts-exchange.com/questions/26977577/Cron-Not-working.html
woolmilkporc

That's why I deleted my comment - I was totally on the wrong track - don't have much time at this very moment.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
woolmilkporc

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?
legolasthehansy

Check as root - "crontab -l"
See if the changes you made reflect on the Cron.
AdrianSmithUK

ASKER
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)
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
AdrianSmithUK

ASKER
Dear legolasthehansy

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

Open in new window


I'm using Centos 6. When I run the command I get nothing.
SOLUTION
legolasthehansy

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
woolmilkporc

"crontab -l" would only work on root's crontab, not on /etc/crontab

Same confusion as mine before.

Did you recycle crond?
AdrianSmithUK

ASKER
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?
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
SOLUTION
woolmilkporc

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
legolasthehansy

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.
ASKER CERTIFIED SOLUTION
AdrianSmithUK

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
AdrianSmithUK

ASKER
Great Support!