[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Time & CmdSchedule
On Sun, 5 Dec 1999, Daniel E. Markle wrote:
> On Sun, Dec 05, 1999 at 05:04:46PM -0800, Aaron Turner wrote:
> > > * * * * * CmdSchedule --repeat 3 --email "syntax@pa.net,jpincin@linuxkb.org,aturner@linuxkb.org" --reportonfail
> > But how does cron store state? Ie, how does it know how many time it has
> > already executed to know if it should run again?
>
> Simple, you have script change the line to --repeat (--n), when it gets to 0
> it is automatically deleted.
ouch. You get major file locking pains because two different scripts can
be executed at the same time and each will want to edit their respective
repeat value in the same crontab file.
> > CmdSchedule.pl runs via cron every minute. It looks up what needs to be
>
> My only concern is what happens if CmdSchedule.pl starts taking more than one
> minute? I guess that means we need a more powerful machine ;)
Actually that's not a problem. Since cron forks a seperate CmdSchedule.pl
instance for each time period, they can run independant. We also have a
"running" value in the DB so that CmdSchedule won't let the same command
run twice at the same time.
> > Anyways, the point it that there isn't that much manual coding to be done.
>
> In this case I'll shut up and go away now ;)
Aw, don't do that :)
> > what. Even worse if someone ever goes in the crontab file and does a
> > manual edit.
>
> That's like saying it's bad if someone goes in and does a manual hexedit on
> your database file. Yeah, that's why you don't do it.
Yeah, but I think there is a greater chance for someone who isn't in the
know to go in and edit a crontab file with a text editor than a SQL DB
file with a hex editor. But, that's just me. :)
--
Aaron Turner, Core Developer http://vodka.linuxkb.org/~aturner/
Linux Knowledge Base Organization http://linuxkb.org/
Because world domination requires quality open documentation.
aka: aturner@vicinity.com, aturner@pobox.com, ion_beam_head@ashtech.net