1832493 Members
6068 Online
110043 Solutions
New Discussion

Re: at queues

 
jigeay
Advisor

at queues

Bonjour,
I'd like to know if there is anyway to stop and restart an atqueue ? eg. I don't wan't the queue "d" to run between 7am and 7pm, but people still can enqueue jobs in it during the day. At 7pm, the queue is "released", and jobs piles down.

thank you.
5 REPLIES 5
James R. Ferguson
Acclaimed Contributor

Re: at queues

Hi Matthieu:

You could craft a root crontask that swaps either the file '/usr/lib/cron/at.allow' or '/usr/lib/cron/at.deny' before and after the period of time you want to restrict.

For example, to stop 'at' queuing, by all users, replace the '/usr/lib/cron/at.allow' file with a null file, saving the current file with an alternate name. To re-enable 'at' activity, copy the saved file back.

Regards!

...JRF...
jigeay
Advisor

Re: at queues

But users won't be able to send an atjob while the queue being stopped, will they ?
James R. Ferguson
Acclaimed Contributor

Re: at queues

Hi (again) Matthieu:

> But users won't be able to send an atjob while the queue being stopped, will they ?

Yes, that is true. I'm sorry, I glossed over that part of your requirement in answering your original query.

My suggestion treats the 'at' mechanism as an interactive, ad hoc one. Hence, my thinking is/was that the user would be denied the submission but could perform it again later.

Regards!

...JRF...
Ralph Grothe
Honored Contributor

Re: at queues

No, they will be rejected.
But I doubt that an at job is the appropriate form since you daily seem to want to have an accumulated bunch of users' jobs executed, if I understood you correctly.
Maybe you could script up something where you build up a batch of users' jobs over the day and parse them with sufficient authorization checking, which I assume can be cumbersome, to finally have them run at usual batch jobs at a scheduled time.
Linux boxes usually come with a daemon that is called "anacron" and which caters for the usual desktop PC situation where the host is not running continuously like a server but powered down at irregular intervals.
Maybe you can get a port for other Unices as well?
http://en.wikipedia.org/wiki/Anacron
Madness, thy name is system administration
jigeay
Advisor

Re: at queues

Thank you for your replies.
Ralph, i'm totally agree with you, and that is what i've tried to explain to the user who wants me to do such a thing. Finaly, i wrote a script which tests the time befor executing each job but i'm not happy with that.
I'm going to look for anacron.