1833980 Members
1993 Online
110063 Solutions
New Discussion

Re: order in queue

 
jigeay
Advisor

order in queue

Hi,

On HP-UX 11.11, when i try to batch several jobs in the same minute (eg : at -qt now) ; the order is not kept.
For example, i batch the job a, wich last 2 minutes, then the job b (2 minutes) and the job c (2 minutes), there is chance that job c will begin before job b (queus are configured to launch one job at a time).
Is there a way to keep the right order ?

thank-you.
3 REPLIES 3
James R. Ferguson
Acclaimed Contributor

Re: order in queue

Hi:

Consider specifying the starttime down to the second:

# at -f ./myscript1 -t 11051155.01
# at -f ./myscript2 -t 11051155.02
# at -f ./myscript3 -t 11051155.03

Regards!

...JRF...



Bill Hassell
Honored Contributor

Re: order in queue

When multiple jobs are scheduled in cron, at or batch, there will always be a possibility that the jobs will overlap as different data or other circumstances occur (ie, long disk delays). One way to assure the correct order is to use a lock file where the state of a dependent processes is kept. When the lock file exists, the process is running and the last step of the script/program is to remove the lock file. Note that there is nothing special about the file - a simple touch to create a zero-length file is adequate.


Bill Hassell, sysadmin
Dennis Handly
Acclaimed Contributor

Re: order in queue

>Is there a way to keep the right order?

What do you mean by order? If you want the second to follow the first, you should have the first start the second. And so on.

JRF and Bill have other suggestions if you don't want to wait until the end of the previous job.

>(queus are configured to launch one job at a time).

This and JRF's suggestion may be all you need.