<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
    <meta name="generator" content="HTML Tidy, see www.w3.org">
    <title>Holding and Releasing Jobs</title>
    <meta name="GENERATOR" content=
    "Modular DocBook HTML Stylesheet Version 1.7">
    <link rel="HOME" title=" LPRng Reference Manual" href=
    "index.htm">
    <link rel="UP" title="Print Spooling Tutorial " href=
    "tutorial.htm">
    <link rel="PREVIOUS" title=
    "Print Job Classes, User Requested Job Priority, and Form Support"
     href="x3472.htm">
    <link rel="NEXT" title="Load Balance Queues and Printer Pools"
    href="x3595.htm">
  </head>

  <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link=
  "#0000FF" vlink="#840084" alink="#0000FF">
    <div class="NAVHEADER">
      <table summary="Header navigation table" width="100%" border=
      "0" cellpadding="0" cellspacing="0">
        <tr>
          <th colspan="3" align="center">LPRng Reference Manual: 24
          Sep 2004 (For LPRng-3.8.28)</th>
        </tr>

        <tr>
          <td width="10%" align="left" valign="bottom"><a href=
          "x3472.htm" accesskey="P">Prev</a></td>

          <td width="80%" align="center" valign="bottom">Chapter 4.
          Print Spooling Tutorial</td>

          <td width="10%" align="right" valign="bottom"><a href=
          "x3595.htm" accesskey="N">Next</a></td>
        </tr>
      </table>
      <hr align="LEFT" width="100%">
    </div>

    <div class="SECT1">
      <h1 class="SECT1"><a name="AEN3517">4.16. Holding and
      Releasing Jobs</a></h1>

      <p>The <b class="APPLICATION">LPRng</b> software has a wide
      range of facilities to hold or temporarily prevent jobs from
      printing. Jobs can be individually held or all jobs submitted
      to a queue can be held until released by an operator. Some
      administrators use the <tt class="COMMAND">holdall</tt>
      facility and a <b class="APPLICATION">cron</b> script to
      cause jobs to be printed at specific times. The <tt class=
      "COMMAND">lpc holdall</tt> command causes all jobs submitted
      to a queue to be held until released with the <tt class=
      "COMMAND">lpc release</tt> command. The <tt class=
      "COMMAND">lpc noholdall</tt> command disables the <tt class=
      "COMMAND">holdall</tt> operation.</p>

      <p>Edit the printcap file so it has contents indicated below,
      use <tt class="COMMAND">checkpc -f</tt> to check the
      printcap, and then use <tt class="COMMAND">lpc reread</tt> to
      restart the <b class="APPLICATION">lpd</b> server.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN3531"></a>
<pre class="SCREEN">
    lp:force_localhost
    lp:server
      :sd=/var/spool/lpd/%P
      :lp=lp2@localhost
    lp2:force_localhost
    lp2:server
      :sd=/var/spool/lpd/%P
      :lp=/tmp/lp2
</pre>
      </div>
      <br>
      <br>

      <p>Execute the following commands to print the <tt class=
      "FILENAME">/tmp/hi</tt> file and observe the results:</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN3535"></a>
<pre class="SCREEN">
    <samp class="PROMPT">h4: {256} %</samp> <kbd class=
"USERINPUT">lpc holdall lp</kbd>
    Printer: lp@h4
    lp@h4.private: holdall on
    <samp class="PROMPT">h4: {257} %</samp> <kbd class=
"USERINPUT">lpq</kbd>
    Printer: lp@h4  (holdall)
     Queue: no printable jobs in queue
    <samp class="PROMPT">h4: {258} %</samp> <kbd class=
"USERINPUT">lpr /tmp/hi</kbd>
    <samp class="PROMPT">h4: {259} %</samp> <kbd class=
"USERINPUT">lpq</kbd>
    Printer: lp@h4  (holdall)
     Queue: no printable jobs in queue
     Holding: 1 held jobs in queue
     Server: no server active
     Rank   Owner/ID           Class Job Files        Size Time
    hold   papowell@h4+213       A   213 /tmp/hi         3 09:45:05
    <samp class="PROMPT">h4: {260} %</samp> <kbd class=
"USERINPUT">lpc release lp 213</kbd>
    Printer: lp@h4
    lp: selected 'papowell@h4+213'
    lp@h4.private: started
    <samp class="PROMPT">h4: {261} %</samp> <kbd class=
"USERINPUT">lpq</kbd>
    Printer: lp@h4  (holdall)
     Queue: no printable jobs in queue
     Status: job 'papowell@h4+213' removed at 09:45:22.570
</pre>
      </div>
      <br>
      <br>

      <p>The <tt class="COMMAND">lpc holdall</tt> command causes
      all jobs to be held. We spool a job, and then use the <tt
      class="COMMAND">lpc release</tt> command to release the
      selected job. We disable the <tt class="COMMAND">holdall</tt>
      operation using the <tt class="COMMAND">lpc noholdall</tt>
      command.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN3554"></a>
<pre class="SCREEN">
    <samp class="PROMPT">h4: {262} %</samp> <kbd class=
"USERINPUT">lpc noholdall lp</kbd>
    Printer: lp@h4
    lp@h4.private: holdall off
</pre>
      </div>
      <br>
      <br>

      <p>You can also use the <tt class="COMMAND">lpc hold</tt>
      command to select individual jobs in a spool queue to be
      held. This command is useful if there is a set of jobs which
      require special handling or printing at a later date. The
      following example shows how this command is used. We use the
      <tt class="COMMAND">lpc stop</tt> and <tt class="COMMAND">lpc
      start</tt> commands to simulate the normal delays in print
      spooling operations.</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN3562"></a>
<pre class="SCREEN">
    <samp class="PROMPT">h4: {263} %</samp> <kbd class=
"USERINPUT">lpc stop lp</kbd>
    Printer: lp@h4
    lp@h4.private: stopped
    <samp class="PROMPT">h4: {264} %</samp> <kbd class=
"USERINPUT">lpq</kbd>
    Printer: lp@h4  (printing disabled)
     Queue: no printable jobs in queue
     Status: job 'papowell@h4+495' removed at 10:10:50.629
    <samp class="PROMPT">h4: {265} %</samp> <kbd class=
"USERINPUT">lpr /tmp/hi</kbd>
    <samp class="PROMPT">h4: {266} %</samp> <kbd class=
"USERINPUT">lpr /tmp/hi</kbd>
    <samp class="PROMPT">h4: {267} %</samp> <kbd class=
"USERINPUT">lpq</kbd>
    Printer: lp@h4  (printing disabled)
     Queue: 2 printable jobs
     Server: no server active
     Rank   Owner/ID           Class Job Files        Size Time
    1      papowell@h4+459       A   459 /tmp/hi         3 10:40:32
    2      papowell@h4+461       A   461 /tmp/hi         3 10:40:34
    <samp class="PROMPT">h4: {268} %</samp> <kbd class=
"USERINPUT">lpc hold lp 459</kbd>
    Printer: lp@h4
    lp: selected 'papowell@h4+459'
    lp@h4.private: updated
    <samp class="PROMPT">h4: {269} %</samp> <kbd class=
"USERINPUT">lpq</kbd>
    Printer: lp@h4  (printing disabled)
     Queue: 1 printable job
     Holding: 1 held jobs in queue
     Server: no server active
     Rank   Owner/ID           Class Job Files        Size Time
    1      papowell@h4+461       A   461 /tmp/hi         3 10:40:34
    hold   papowell@h4+459       A   459 /tmp/hi         3 10:40:32
</pre>
      </div>
      <br>
      <br>

      <p>In the next example we show how to use the <tt class=
      "COMMAND">lpc hold</tt> command to select and hold an
      individual job. Then we start the queue and see what
      happens:</p>

      <div class="INFORMALEXAMPLE">
        <a name="AEN3580"></a>
<pre class="SCREEN">
    <samp class="PROMPT">h4: {270} %</samp> <kbd class=
"USERINPUT">lpc start</kbd>
    Printer: lp@h4
    lp@h4.private: started
    <samp class="PROMPT">h4: {271} %</samp> <kbd class=
"USERINPUT">lpq</kbd>
    Printer: lp@h4
     Queue: no printable jobs in queue
     Holding: 1 held jobs in queue
     Server: no server active
     Status: job 'papowell@h4+461' removed at 10:41:24.873
     Rank   Owner/ID           Class Job Files        Size Time
    hold   papowell@h4+459       A   459 /tmp/hi         3 10:40:32
    <samp class="PROMPT">h4: {272} %</samp> <kbd class=
"USERINPUT">lpc release lp 459</kbd>
    Printer: lp@h4
    lp: selected 'papowell@h4+459'
    lp@h4.private: started
    <samp class="PROMPT">h4: {273} %</samp> <kbd class=
"USERINPUT">lpq</kbd>
    Printer: lp@h4
     Queue: no printable jobs in queue
     Status: job 'papowell@h4+459' removed at 10:41:39.457
</pre>
      </div>
      <br>
      <br>

      <p>As we see, the held job is not printed until we release
      it, and then is processed normally.</p>

      <p>The printcap <var class="LITERAL">:ah</var> (autohold)
      option has the same effect as the <tt class="COMMAND">lpc
      holdall</tt> command but its actions cannot be disabled by
      the <tt class="COMMAND">lpc noholdall</tt> command.</p>
    </div>

    <div class="NAVFOOTER">
      <hr align="LEFT" width="100%">

      <table summary="Footer navigation table" width="100%" border=
      "0" cellpadding="0" cellspacing="0">
        <tr>
          <td width="33%" align="left" valign="top"><a href=
          "x3472.htm" accesskey="P">Prev</a></td>

          <td width="34%" align="center" valign="top"><a href=
          "index.htm" accesskey="H">Home</a></td>

          <td width="33%" align="right" valign="top"><a href=
          "x3595.htm" accesskey="N">Next</a></td>
        </tr>

        <tr>
          <td width="33%" align="left" valign="top">Print Job
          Classes, User Requested Job Priority, and Form
          Support</td>

          <td width="34%" align="center" valign="top"><a href=
          "tutorial.htm" accesskey="U">Up</a></td>

          <td width="33%" align="right" valign="top">Load Balance
          Queues and Printer Pools</td>
        </tr>
      </table>
    </div>
  </body>
</html>



syntax highlighted by Code2HTML, v. 0.9.1