home | O'Reilly's CD bookshelfs | FreeBSD | Linux | Cisco | Cisco Exam  


UNIX Power Tools

UNIX Power ToolsSearch this book
Previous: 40.5 Avoiding Other at and cron Jobs Chapter 40
Delayed Execution
Next: 40.7 Making Your at Jobs Quiet
 

40.6 System V.4 Batch Queues

At many UNIX sites, batch submission systems are considered a thing of the past. This is unfortunate. Batch execution is an effective way to get a lot of work done, particularly in a production-oriented environment. A batch queue is one of the best ways to ensure that a computer remains active during off hours. The at command leads to "bursty" execution: you will see a lot of activity at midnight, 1 a.m., 2 a.m., and other popular submission times, trailing off as the jobs complete. A batch queue will keep the system running on an even keel as long as there is work left to do.

System V.4 and SunOS have added a very simple batch queue facility. This facility is really just a variation of the at command, except that you can't specify when you want to run the job. The system has a single batch queue that executes jobs in the order in which they are entered into the queue. Submit a job to the queue with the command:

% 

batch




Command 1
Command 2



[CTRL-d]

If you have written your job as a shell script, you can submit it as:

% 

batch 



script-name

But check your online batch manual page to be sure that your system will run it with the right shell. To delete jobs from the queue, use atq and atrm (SunOS) or at -l and at -r (V.4).

The queue facility is so simple that it's pathetic: it doesn't support multiple queues, queue priorities, and other features that you really need if you want batch submission. But it will do one important thing. If users use batch queues for their big jobs, they will guarantee that, at most, one large program (whether it is the compiler, an engineering application, or whatever) is running at a time. That may be all you need to restore order to a troubled system.

- ML from O'Reilly & Associates' System Performance Tuning , Chapter 3


Previous: 40.5 Avoiding Other at and cron Jobs UNIX Power Tools Next: 40.7 Making Your at Jobs Quiet
40.5 Avoiding Other at and cron Jobs Book Index 40.7 Making Your at Jobs Quiet

The UNIX CD Bookshelf Navigation The UNIX CD BookshelfUNIX Power ToolsUNIX in a NutshellLearning the vi Editorsed & awkLearning the Korn ShellLearning the UNIX Operating System