PDA

View Full Version : */30 - new crontab method?!


weddingsite
9-30-04, 12:17 PM
Powweb suggested me to use

*/30 * * * * instead of 30 * * * *

However this looks like it is running the script every 30 minutes instead of every half hour.

Anyone familiar with this */ method?

NMS
9-30-04, 01:08 PM
Are you sure you wrote this properly. What do you want to achieve?

RocketJeff
9-30-04, 01:10 PM
Powweb suggested me to use

*/30 * * * * instead of 30 * * * *

However this looks like it is running the script every 30 minutes instead of every half hour.

Anyone familiar with this */ method?

See the Crontab Man Page (http://www.gsp.com/cgi-bin/man.cgi?section=5&topic=crontab) for more information then you'll ever want about the crontab file.

And, yes, */30 tells cron to run the job every 30 minutes instead of at the half-hour point.

30 * * * * is a valid value - I actually use it in my crontab as a simple check.
You might want to try adding it to your's also, it's simply:
30 * * * * /bin/date >>/www/U/USERNAME/logs/date.log
That way I can look in date.log to make sure cron's been running. I just check it and it's putting out a date/time line every hour on the half-hour.

nli
9-30-04, 01:26 PM
Hi,

I'm the one that set that up. Isn't that every hour at the 30th min? I could be wrong... I'm no cron expert. But hey, at least I got it to run. :) Good luck in customizing the time. I'll see if I can find any other resources later today.

NMS
9-30-04, 01:38 PM
*/30 runs every 30 minutes

30 runs every half hour

tbonekkt
9-30-04, 01:42 PM
Correct - the 30 minute is a unique time.

/15 * * * * runs every 15 minutes
15 * * * * runs 15 past the hour

weddingsite
10-2-04, 04:13 PM
*/30 runs every 30 minutes
30 runs every half hour

Yes I know that. I want 30 * * * * ie: every 30 half hour.

*/30 * * * * works fine BUT 30 * * * * DOES NOT!!

One thing which looks like no one is understanding is that the very same statement with 30 * * * * used to work for over a year! It suddenly isn't working any more. I change the first part to */30 and runs every 30 mins. Back to 30 * * * * and nothing!

I am afraid there is a problem from Powweb's side. My synatax is valid, it has always been....

30 * * * * /www/w/weddingsite/cgi-bin/aw/awstats.pl -config=theweddingsite.com -update>>/www/w/weddingsite/logs/cronow.log 2>>/www/w/weddingsite/logs/cronaw.err

The above is not running any longer...powweb said 'wrong syntax - bad hour...BUT...

*/30 * * * * /www/w/weddingsite/cgi-bin/aw/awstats.pl -config=theweddingsite.com -update>>/www/w/weddingsite/logs/cronow.log 2>>/www/w/weddingsite/logs/cronaw.err

ie; the same exact entry but with */30 work without errors!

This problem started all of a sudden in August!

NMS
10-3-04, 04:36 AM
Why are you running awstats every 30 minutes? That is really useless! Sorry but I had to say it :)

Change it to hourly or bi-hourly!

weddingsite
10-4-04, 09:07 AM
That is what I am saying!!!!

I used to run it every half hour with 30 * * * *

Now I have to run it every 30 mins with /30 * * * * as for a STRANGE reason 30 * * * * is not running any longer!

NMS
10-4-04, 04:08 PM
Ok, but why do you want awstats to update every 30 minutes? What about changing it to hourly? That will even decrease the server load.

weddingsite
10-4-04, 04:27 PM
We are not understanding each other (and we are both Maltese! :) )

My crontab used to run every hour and that's how I want it. I used to use 30 * * * *
This made it run every hour, but on the half hour, ie; 2:30, 3:30, 4:30 etc...

My crontab now, since around 4th August, is not accepting this method of {any number less than 60} * * * * but is only accepting {*/anynumber} * * * * eg: */30 * * * * which makes it run every 30 mins ...twice per hour.

I do not want this... I want it every hour, like it was but when I input 30 * * * * nothing runs and powweb told me the error is 'bad hour/wrong syntax'

The problem is that Powweb have decided that it is something wrong from my end..I need them to investigate it more as this error is very strange.

IanS
10-4-04, 04:42 PM
We are not understanding each other (and we are both Maltese! :) )

My crontab used to run every hour and that's how I want it. I used to use 30 * * * *
This made it run every hour, but on the half hour, ie; 2:30, 3:30, 4:30 etc...

My crontab now, since around 4th August, is not accepting this method of {any number less than 60} * * * * but is only accepting {*/anynumber} * * * * eg: */30 * * * * which makes it run every 30 mins ...twice per hour.

I do not want this... I want it every hour, like it was but when I input 30 * * * * nothing runs and powweb told me the error is 'bad hour/wrong syntax'

The problem is that Powweb have decided that it is something wrong from my end..I need them to investigate it more as this error is very strange.Why not compromise and put the code to do it every 59 mins - close enough to an hour, surely.

If I've followed this correctly, the syntax would be */59 * * * *
(but then you knew that bit).:)

RocketJeff
10-4-04, 06:05 PM
Why not compromise and put the code to do it every 59 mins - close enough to an hour, surely.

If I've followed this correctly, the syntax would be */59 * * * *
(but then you knew that bit).:)
Either that, or try it at some other time during the hour, like at 29 or 31 after the hour (29 * * * * or 31 * * * *)

weddingsite
10-5-04, 06:09 AM
Why not compromise and put the code to do it every 59 mins - close enough to an hour, surely.

If I've followed this correctly, the syntax would be */59 * * * *
(but then you knew that bit).:)

Yes, that will work and I knew it. I just used the 30 * * * * as an example.
The problem comes as I have another entry in the crontab which use to run at 13:01 ie I had - 1 13 * * *

Since this also it is not working how shall I do it with the new method, ie using the /

The required solution is to have POWWEB look into this more in detail!