⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch40_06.htm

📁 the unix power tools
💻 HTM
字号:
<HTML><!--Distributed by F --><HEAD><TITLE>[Chapter 40] 40.6 System V.4 Batch Queues </TITLE><METANAME="DC.title"CONTENT="UNIX Power Tools"><METANAME="DC.creator"CONTENT="Jerry Peek, Tim O'Reilly &amp; Mike Loukides"><METANAME="DC.publisher"CONTENT="O'Reilly &amp; Associates, Inc."><METANAME="DC.date"CONTENT="1998-08-04T21:50:36Z"><METANAME="DC.type"CONTENT="Text.Monograph"><METANAME="DC.format"CONTENT="text/html"SCHEME="MIME"><METANAME="DC.source"CONTENT="1-56592-260-3"SCHEME="ISBN"><METANAME="DC.language"CONTENT="en-US"><METANAME="generator"CONTENT="Jade 1.1/O'Reilly DocBook 3.0 to HTML 4.0"><LINKREV="made"HREF="mailto:online-books@oreilly.com"TITLE="Online Books Comments"><LINKREL="up"HREF="ch40_01.htm"TITLE="40. Delayed Execution"><LINKREL="prev"HREF="ch40_05.htm"TITLE="40.5 Avoiding Other at and cron Jobs "><LINKREL="next"HREF="ch40_07.htm"TITLE="40.7 Making Your at Jobs Quiet "></HEAD><BODYBGCOLOR="#FFFFFF"TEXT="#000000"><DIVCLASS="htmlnav"><H1><IMGSRC="gifs/smbanner.gif"ALT="UNIX Power Tools"USEMAP="#srchmap"BORDER="0"></H1><MAPNAME="srchmap"><AREASHAPE="RECT"COORDS="0,0,466,58"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="467,0,514,18"HREF="jobjects/fsearch.htm"ALT="Search this book"></MAP><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch40_05.htm"TITLE="40.5 Avoiding Other at and cron Jobs "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 40.5 Avoiding Other at and cron Jobs "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><B><FONTFACE="ARIEL,HELVETICA,HELV,SANSERIF"SIZE="-1">Chapter 40<BR>Delayed Execution</FONT></B></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch40_07.htm"TITLE="40.7 Making Your at Jobs Quiet "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 40.7 Making Your at Jobs Quiet "BORDER="0"></A></TD></TR></TABLE>&nbsp;<HRALIGN="LEFT"WIDTH="515"TITLE="footer"></DIV><DIVCLASS="SECT1"><H2CLASS="sect1"><ACLASS="title"NAME="UPT-ART-2312">40.6 System V.4 Batch Queues </A></H2><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-44696"></A>At many UNIX sites, batch submission systems are considered a thing ofthe past. This is unfortunate. Batch execution is an effective way toget 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 remainsactive during off hours. The <EMCLASS="emphasis">at</EM> command leads to &quot;bursty&quot;execution: you will see a lot of activity at midnight, 1 a.m., 2 a.m., andother 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.</P><PCLASS="para"><ACLASS="indexterm"NAME="AUTOID-44700"></A><ACLASS="indexterm"NAME="AUTOID-44702"></A>System V.4 and SunOS have added a very simple batch queue facility. Thisfacility is really just a variation of the <EMCLASS="emphasis">at</EM> command,except that you can't specify when you want to run thejob. The system has a single batch queue that executes jobsin theorder in which they are entered into the queue. Submit a job tothe queue with the command:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>batch</B></CODE><CODECLASS="replaceable"><I>Command 1Command 2</I></CODE><KBDCLASS="keycap">[CTRL-d]</KBD></PRE></BLOCKQUOTE></P><PCLASS="para">If you have written your job as a shell script, you can submit it as:</P><PCLASS="para"><BLOCKQUOTECLASS="screen"><PRECLASS="screen">% <CODECLASS="userinput"><B>batch </B></CODE><CODECLASS="replaceable"><I>script-name</I></CODE></PRE></BLOCKQUOTE></P><PCLASS="para">But check your online <EMCLASS="emphasis">batch</EM> manual page to be surethat your system will run it with the right shell.To delete jobs from the queue, use <EMCLASS="emphasis">atq</EM> and <EMCLASS="emphasis">atrm</EM> (SunOS) or<EMCLASS="emphasis">at -l</EM> and <EMCLASS="emphasis">at -r</EM> (V.4).</P><PCLASS="para">The queue facility is so simple that it's pathetic: it doesn't supportmultiple queues, queue priorities, and other features that you reallyneed if you want batch submission. But it will do one importantthing. If users use batch queues for theirbig jobs, they will guarantee that, at most, one large program (whetherit is the compiler, an engineering application, or whatever) is running ata time. That may be all you need to restore order to a troubled system.</P><DIVCLASS="sect1info"><PCLASS="SECT1INFO">- <SPANCLASS="authorinitials">ML</SPAN> <SPANCLASS="bibliomisc">from O'Reilly &amp; Associates' <CITECLASS="citetitle">System Performance Tuning</CITE>, Chapter 3</SPAN></P></DIV></DIV><DIVCLASS="htmlnav"><P></P><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><TABLEWIDTH="515"BORDER="0"CELLSPACING="0"CELLPADDING="0"><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch40_05.htm"TITLE="40.5 Avoiding Other at and cron Jobs "><IMGSRC="gifs/txtpreva.gif"SRC="gifs/txtpreva.gif"ALT="Previous: 40.5 Avoiding Other at and cron Jobs "BORDER="0"></A></TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="book"HREF="index.htm"TITLE="UNIX Power Tools"><IMGSRC="gifs/txthome.gif"SRC="gifs/txthome.gif"ALT="UNIX Power Tools"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172"><ACLASS="SECT1"HREF="ch40_07.htm"TITLE="40.7 Making Your at Jobs Quiet "><IMGSRC="gifs/txtnexta.gif"SRC="gifs/txtnexta.gif"ALT="Next: 40.7 Making Your at Jobs Quiet "BORDER="0"></A></TD></TR><TR><TDALIGN="LEFT"VALIGN="TOP"WIDTH="172">40.5 Avoiding Other at and cron Jobs </TD><TDALIGN="CENTER"VALIGN="TOP"WIDTH="171"><ACLASS="index"HREF="index/idx_0.htm"TITLE="Book Index"><IMGSRC="gifs/index.gif"SRC="gifs/index.gif"ALT="Book Index"BORDER="0"></A></TD><TDALIGN="RIGHT"VALIGN="TOP"WIDTH="172">40.7 Making Your at Jobs Quiet </TD></TR></TABLE><HRALIGN="LEFT"WIDTH="515"TITLE="footer"><IMGSRC="gifs/smnavbar.gif"SRC="gifs/smnavbar.gif"USEMAP="#map"BORDER="0"ALT="The UNIX CD Bookshelf Navigation"><MAPNAME="map"><AREASHAPE="RECT"COORDS="0,0,73,21"HREF="../index.htm"ALT="The UNIX CD Bookshelf"><AREASHAPE="RECT"COORDS="74,0,163,21"HREF="index.htm"ALT="UNIX Power Tools"><AREASHAPE="RECT"COORDS="164,0,257,21"HREF="../unixnut/index.htm"ALT="UNIX in a Nutshell"><AREASHAPE="RECT"COORDS="258,0,321,21"HREF="../vi/index.htm"ALT="Learning the vi Editor"><AREASHAPE="RECT"COORDS="322,0,378,21"HREF="../sedawk/index.htm"ALT="sed &amp; awk"><AREASHAPE="RECT"COORDS="379,0,438,21"HREF="../ksh/index.htm"ALT="Learning the Korn Shell"><AREASHAPE="RECT"COORDS="439,0,514,21"HREF="../lrnunix/index.htm"ALT="Learning the UNIX Operating System"></MAP></DIV></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -