| View previous topic :: View next topic |
| Author |
Message |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Fri Feb 25, 2011 11:51 am Post subject: |
|
|
I had a look at them site you posted but i still get confused as they do say "* */1 * * *" every 1 hour
or
"* *1-24 * * *"
and for every 2 hours it be like this:
"* *0,2,4,6,8,10,12,14,16,18,20,22 * * *"
is this correct. Its very confusing but i guess once u get the hang of it, it gets easyer to understand.
Thanks
Gemster |
|
| Back to top |
|
 |
caesar Mint Rubber

Joined: 14 Oct 2001 Posts: 3741 Location: Mint Factory
|
Posted: Fri Feb 25, 2011 12:13 pm Post subject: |
|
|
| Quote: |
It can contain up to five fields: minute, hour, day, month, weekday; delimited by whitespace.
|
So the "* */1 * * *" should trigger once every hour, 24/7/365 (or 366). A 'every two hours' crontab mask will be: "* */2 * * *" _________________ Once the game is over, the king and the pawn go back in the same box. |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Fri Feb 25, 2011 1:39 pm Post subject: |
|
|
| Gemster wrote: |
...
Its very confusing but i guess once u get the hang of it, it gets easyer to understand.
|
I won't argue with that.
Try:
"0 * * * *"
Won't that make it run every hour, on the minute that ends in :00 ?
If you want to choose a different minute of the hour, just change that number.
Disclaimer:
I'm not saying that this is THE right way to do it. Perhaps someone else will be along...
In the meantime, try it, and let us know. |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Fri Feb 25, 2011 1:58 pm Post subject: |
|
|
| caesar wrote: | | Quote: |
It can contain up to five fields: minute, hour, day, month, weekday; delimited by whitespace.
|
So the "* */1 * * *" should trigger once every hour, 24/7/365 (or 366). A 'every two hours' crontab mask will be: "* */2 * * *" |
It dosent tho. Even if i do "* */2 * * *" or "* */3 * * *" it still triggers every minute as tho its ignoring the /1, /2 or /3.
Yes willyw it works with "0 * * * *" but what if i need it for every 2 hours or every 3 hours ?
Thanks
Gemster |
|
| Back to top |
|
 |
willyw Revered One
Joined: 15 Jan 2009 Posts: 1175
|
Posted: Fri Feb 25, 2011 2:16 pm Post subject: |
|
|
| Gemster wrote: |
...
Yes willyw it works with "0 * * * *" but what if i need it for every 2 hours or every 3 hours ?
|
Here:
http://www.linuxhelp.net/guides/cron/
it says
| Quote: |
If you wanted to run a command every 2 hours you could enter in */2 for the hour field. This would run the specified command at 2am, 4am, 6am, 8am, 10am, 12pm, 2pm, and so on. An example of this type of entry would be:
0 */2 * * *
|
And if that doesn't work, I wonder...
what if you entered a list of specific hours?
"0 0,2,4,6,8,10,12,14,16,18,20,22 * * *" |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Fri Feb 25, 2011 2:44 pm Post subject: |
|
|
Ok willyw,
Testing 0 */2 * * * now to see if that works, if not ill test the "0 0,2,4,6,8,10,12,14,16,18,20,22 * * *".
I guess thats a 4 hour test lol.
Ill let u know if any of them work in 4 hours
Thanks
Gemster |
|
| Back to top |
|
 |
Gemster Halfop
Joined: 04 Oct 2010 Posts: 51
|
Posted: Fri Feb 25, 2011 4:19 pm Post subject: |
|
|
Ok "0 */2 * * *" seems to be working so far
I think what the problem is , is that the first * meens every minute so that would explain why "* */2 * * *" done the command every minute instead of every 2 hours.
Thanks
Gemster
Edit: Yes its working every 2 hours with "0 */2 * * *"  |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|