egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

varibles help
Goto page Previous  1, 2
 
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests
View previous topic :: View next topic  
Author Message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Fri Feb 25, 2011 11:51 am    Post subject: Reply with quote

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
View user's profile Send private message
caesar
Mint Rubber


Joined: 14 Oct 2001
Posts: 3741
Location: Mint Factory

PostPosted: Fri Feb 25, 2011 12:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Fri Feb 25, 2011 1:39 pm    Post subject: Reply with quote

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. Smile

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
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Fri Feb 25, 2011 1:58 pm    Post subject: Reply with quote

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
View user's profile Send private message
willyw
Revered One


Joined: 15 Jan 2009
Posts: 1175

PostPosted: Fri Feb 25, 2011 2:16 pm    Post subject: Reply with quote

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
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Fri Feb 25, 2011 2:44 pm    Post subject: Reply with quote

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 Very Happy

Thanks
Gemster
Back to top
View user's profile Send private message
Gemster
Halfop


Joined: 04 Oct 2010
Posts: 51

PostPosted: Fri Feb 25, 2011 4:19 pm    Post subject: Reply with quote

Ok "0 */2 * * *" seems to be working so far Very Happy

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 * * *" Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    egghelp.org community Forum Index -> Script Requests All times are GMT - 4 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
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


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber