• Home
  • History
  • Annotate
  • Line#
  • Navigate
  • Raw
  • Download
  • only in /asuswrt-rt-n18u-9.0.0.4.380.2695/release/src/router/LPRng/DOCS/LPRng-Reference-Multipart/
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2
3<html>
4  <head>
5    <meta name="generator" content="HTML Tidy, see www.w3.org">
6    <title>Holding and Releasing Jobs</title>
7    <meta name="GENERATOR" content=
8    "Modular DocBook HTML Stylesheet Version 1.7">
9    <link rel="HOME" title=" LPRng Reference Manual" href=
10    "index.htm">
11    <link rel="UP" title="Print Spooling Tutorial " href=
12    "tutorial.htm">
13    <link rel="PREVIOUS" title=
14    "Print Job Classes, User Requested Job Priority, and Form Support"
15     href="x3470.htm">
16    <link rel="NEXT" title="Load Balance Queues and Printer Pools"
17    href="x3593.htm">
18  </head>
19
20  <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
21  "#0000FF" vlink="#840084" alink="#0000FF">
22    <div class="NAVHEADER">
23      <table summary="Header navigation table" width="100%" border=
24      "0" cellpadding="0" cellspacing="0">
25        <tr>
26          <th colspan="3" align="center">LPRng Reference Manual: 5
27          Sep 2003 (For LPRng-3.8.22)</th>
28        </tr>
29
30        <tr>
31          <td width="10%" align="left" valign="bottom"><a href=
32          "x3470.htm" accesskey="P">Prev</a></td>
33
34          <td width="80%" align="center" valign="bottom">Chapter 4.
35          Print Spooling Tutorial</td>
36
37          <td width="10%" align="right" valign="bottom"><a href=
38          "x3593.htm" accesskey="N">Next</a></td>
39        </tr>
40      </table>
41      <hr align="LEFT" width="100%">
42    </div>
43
44    <div class="SECT1">
45      <h1 class="SECT1"><a name="AEN3515">4.16. Holding and
46      Releasing Jobs</a></h1>
47
48      <p>The <b class="APPLICATION">LPRng</b> software has a wide
49      range of facilities to hold or temporarily prevent jobs from
50      printing. Jobs can be individually held or all jobs submitted
51      to a queue can be held until released by an operator. Some
52      administrators use the <tt class="COMMAND">holdall</tt>
53      facility and a <b class="APPLICATION">cron</b> script to
54      cause jobs to be printed at specific times. The <tt class=
55      "COMMAND">lpc holdall</tt> command causes all jobs submitted
56      to a queue to be held until released with the <tt class=
57      "COMMAND">lpc release</tt> command. The <tt class=
58      "COMMAND">lpc noholdall</tt> command disables the <tt class=
59      "COMMAND">holdall</tt> operation.</p>
60
61      <p>Edit the printcap file so it has contents indicated below,
62      use <tt class="COMMAND">checkpc -f</tt> to check the
63      printcap, and then use <tt class="COMMAND">lpc reread</tt> to
64      restart the <b class="APPLICATION">lpd</b> server.</p>
65
66      <div class="INFORMALEXAMPLE">
67        <a name="AEN3529"></a>
68<pre class="SCREEN">
69    lp:force_localhost
70    lp:server
71      :sd=/var/spool/lpd/%P
72      :lp=lp2@localhost
73    lp2:force_localhost
74    lp2:server
75      :sd=/var/spool/lpd/%P
76      :lp=/tmp/lp2
77</pre>
78      </div>
79      <br>
80      <br>
81
82      <p>Execute the following commands to print the <tt class=
83      "FILENAME">/tmp/hi</tt> file and observe the results:</p>
84
85      <div class="INFORMALEXAMPLE">
86        <a name="AEN3533"></a>
87<pre class="SCREEN">
88    <samp class="PROMPT">h4: {256} %</samp> <kbd class=
89"USERINPUT">lpc holdall lp</kbd>
90    Printer: lp@h4
91    lp@h4.private: holdall on
92    <samp class="PROMPT">h4: {257} %</samp> <kbd class=
93"USERINPUT">lpq</kbd>
94    Printer: lp@h4  (holdall)
95     Queue: no printable jobs in queue
96    <samp class="PROMPT">h4: {258} %</samp> <kbd class=
97"USERINPUT">lpr /tmp/hi</kbd>
98    <samp class="PROMPT">h4: {259} %</samp> <kbd class=
99"USERINPUT">lpq</kbd>
100    Printer: lp@h4  (holdall)
101     Queue: no printable jobs in queue
102     Holding: 1 held jobs in queue
103     Server: no server active
104     Rank   Owner/ID           Class Job Files        Size Time
105    hold   papowell@h4+213       A   213 /tmp/hi         3 09:45:05
106    <samp class="PROMPT">h4: {260} %</samp> <kbd class=
107"USERINPUT">lpc release lp 213</kbd>
108    Printer: lp@h4
109    lp: selected 'papowell@h4+213'
110    lp@h4.private: started
111    <samp class="PROMPT">h4: {261} %</samp> <kbd class=
112"USERINPUT">lpq</kbd>
113    Printer: lp@h4  (holdall)
114     Queue: no printable jobs in queue
115     Status: job 'papowell@h4+213' removed at 09:45:22.570
116</pre>
117      </div>
118      <br>
119      <br>
120
121      <p>The <tt class="COMMAND">lpc holdall</tt> command causes
122      all jobs to be held. We spool a job, and then use the <tt
123      class="COMMAND">lpc release</tt> command to release the
124      selected job. We disable the <tt class="COMMAND">holdall</tt>
125      operation using the <tt class="COMMAND">lpc noholdall</tt>
126      command.</p>
127
128      <div class="INFORMALEXAMPLE">
129        <a name="AEN3552"></a>
130<pre class="SCREEN">
131    <samp class="PROMPT">h4: {262} %</samp> <kbd class=
132"USERINPUT">lpc noholdall lp</kbd>
133    Printer: lp@h4
134    lp@h4.private: holdall off
135</pre>
136      </div>
137      <br>
138      <br>
139
140      <p>You can also use the <tt class="COMMAND">lpc hold</tt>
141      command to select individual jobs in a spool queue to be
142      held. This command is useful if there is a set of jobs which
143      require special handling or printing at a later date. The
144      following example shows how this command is used. We use the
145      <tt class="COMMAND">lpc stop</tt> and <tt class="COMMAND">lpc
146      start</tt> commands to simulate the normal delays in print
147      spooling operations.</p>
148
149      <div class="INFORMALEXAMPLE">
150        <a name="AEN3560"></a>
151<pre class="SCREEN">
152    <samp class="PROMPT">h4: {263} %</samp> <kbd class=
153"USERINPUT">lpc stop lp</kbd>
154    Printer: lp@h4
155    lp@h4.private: stopped
156    <samp class="PROMPT">h4: {264} %</samp> <kbd class=
157"USERINPUT">lpq</kbd>
158    Printer: lp@h4  (printing disabled)
159     Queue: no printable jobs in queue
160     Status: job 'papowell@h4+495' removed at 10:10:50.629
161    <samp class="PROMPT">h4: {265} %</samp> <kbd class=
162"USERINPUT">lpr /tmp/hi</kbd>
163    <samp class="PROMPT">h4: {266} %</samp> <kbd class=
164"USERINPUT">lpr /tmp/hi</kbd>
165    <samp class="PROMPT">h4: {267} %</samp> <kbd class=
166"USERINPUT">lpq</kbd>
167    Printer: lp@h4  (printing disabled)
168     Queue: 2 printable jobs
169     Server: no server active
170     Rank   Owner/ID           Class Job Files        Size Time
171    1      papowell@h4+459       A   459 /tmp/hi         3 10:40:32
172    2      papowell@h4+461       A   461 /tmp/hi         3 10:40:34
173    <samp class="PROMPT">h4: {268} %</samp> <kbd class=
174"USERINPUT">lpc hold lp 459</kbd>
175    Printer: lp@h4
176    lp: selected 'papowell@h4+459'
177    lp@h4.private: updated
178    <samp class="PROMPT">h4: {269} %</samp> <kbd class=
179"USERINPUT">lpq</kbd>
180    Printer: lp@h4  (printing disabled)
181     Queue: 1 printable job
182     Holding: 1 held jobs in queue
183     Server: no server active
184     Rank   Owner/ID           Class Job Files        Size Time
185    1      papowell@h4+461       A   461 /tmp/hi         3 10:40:34
186    hold   papowell@h4+459       A   459 /tmp/hi         3 10:40:32
187</pre>
188      </div>
189      <br>
190      <br>
191
192      <p>In the next example we show how to use the <tt class=
193      "COMMAND">lpc hold</tt> command to select and hold an
194      individual job. Then we start the queue and see what
195      happens:</p>
196
197      <div class="INFORMALEXAMPLE">
198        <a name="AEN3578"></a>
199<pre class="SCREEN">
200    <samp class="PROMPT">h4: {270} %</samp> <kbd class=
201"USERINPUT">lpc start</kbd>
202    Printer: lp@h4
203    lp@h4.private: started
204    <samp class="PROMPT">h4: {271} %</samp> <kbd class=
205"USERINPUT">lpq</kbd>
206    Printer: lp@h4
207     Queue: no printable jobs in queue
208     Holding: 1 held jobs in queue
209     Server: no server active
210     Status: job 'papowell@h4+461' removed at 10:41:24.873
211     Rank   Owner/ID           Class Job Files        Size Time
212    hold   papowell@h4+459       A   459 /tmp/hi         3 10:40:32
213    <samp class="PROMPT">h4: {272} %</samp> <kbd class=
214"USERINPUT">lpc release lp 459</kbd>
215    Printer: lp@h4
216    lp: selected 'papowell@h4+459'
217    lp@h4.private: started
218    <samp class="PROMPT">h4: {273} %</samp> <kbd class=
219"USERINPUT">lpq</kbd>
220    Printer: lp@h4
221     Queue: no printable jobs in queue
222     Status: job 'papowell@h4+459' removed at 10:41:39.457
223</pre>
224      </div>
225      <br>
226      <br>
227
228      <p>As we see, the held job is not printed until we release
229      it, and then is processed normally.</p>
230
231      <p>The printcap <var class="LITERAL">:ah</var> (autohold)
232      option has the same effect as the <tt class="COMMAND">lpc
233      holdall</tt> command but its actions cannot be disabled by
234      the <tt class="COMMAND">lpc noholdall</tt> command.</p>
235    </div>
236
237    <div class="NAVFOOTER">
238      <hr align="LEFT" width="100%">
239
240      <table summary="Footer navigation table" width="100%" border=
241      "0" cellpadding="0" cellspacing="0">
242        <tr>
243          <td width="33%" align="left" valign="top"><a href=
244          "x3470.htm" accesskey="P">Prev</a></td>
245
246          <td width="34%" align="center" valign="top"><a href=
247          "index.htm" accesskey="H">Home</a></td>
248
249          <td width="33%" align="right" valign="top"><a href=
250          "x3593.htm" accesskey="N">Next</a></td>
251        </tr>
252
253        <tr>
254          <td width="33%" align="left" valign="top">Print Job
255          Classes, User Requested Job Priority, and Form
256          Support</td>
257
258          <td width="34%" align="center" valign="top"><a href=
259          "tutorial.htm" accesskey="U">Up</a></td>
260
261          <td width="33%" align="right" valign="top">Load Balance
262          Queues and Printer Pools</td>
263        </tr>
264      </table>
265    </div>
266  </body>
267</html>
268
269