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>Moving Jobs From Queue to Queue and Redirecting 7 Queues</title> 8 <meta name="GENERATOR" content= 9 "Modular DocBook HTML Stylesheet Version 1.7"> 10 <link rel="HOME" title=" LPRng Reference Manual" href= 11 "index.htm"> 12 <link rel="UP" title="Print Spooling Tutorial " href= 13 "tutorial.htm"> 14 <link rel="PREVIOUS" title= 15 "Printing from lpr Directly To A Device" href="x3376.htm"> 16 <link rel="NEXT" title= 17 "Print Job Classes, User Requested Job Priority, and Form Support" 18 href="x3470.htm"> 19 </head> 20 21 <body class="SECT1" bgcolor="#FFFFFF" text="#000000" link= 22 "#0000FF" vlink="#840084" alink="#0000FF"> 23 <div class="NAVHEADER"> 24 <table summary="Header navigation table" width="100%" border= 25 "0" cellpadding="0" cellspacing="0"> 26 <tr> 27 <th colspan="3" align="center">LPRng Reference Manual: 5 28 Sep 2003 (For LPRng-3.8.22)</th> 29 </tr> 30 31 <tr> 32 <td width="10%" align="left" valign="bottom"><a href= 33 "x3376.htm" accesskey="P">Prev</a></td> 34 35 <td width="80%" align="center" valign="bottom">Chapter 4. 36 Print Spooling Tutorial</td> 37 38 <td width="10%" align="right" valign="bottom"><a href= 39 "x3470.htm" accesskey="N">Next</a></td> 40 </tr> 41 </table> 42 <hr align="LEFT" width="100%"> 43 </div> 44 45 <div class="SECT1"> 46 <h1 class="SECT1"><a name="AEN3423">4.14. Moving Jobs From 47 Queue to Queue and Redirecting Queues</a></h1> 48 49 <p>The <tt class="COMMAND">lpc move</tt> command is used to 50 move jobs in one queue to another queue on an individual 51 basis, while the <tt class="COMMAND">lpc redirect</tt> 52 command redirects all incoming jobs to a new queue. Edit the 53 printcap file so it has contents indicated below, use <tt 54 class="COMMAND">checkpc -f</tt> to check the printcap, and 55 then use <tt class="COMMAND">lpc reread</tt> to restart the 56 <b class="APPLICATION">lpd</b> server.</p> 57 58 <div class="INFORMALEXAMPLE"> 59 <a name="AEN3431"></a> 60<pre class="SCREEN"> 61 lp:force_localhost 62 lp:server 63 :sd=/var/spool/lpd/%P 64 :lp=lp2@localhost 65 lp2:force_localhost 66 lp2:server 67 :sd=/var/spool/lpd/%P 68 :lp=/tmp/lp2 69</pre> 70 </div> 71 Execute the following commands to print the <tt class= 72 "FILENAME">/tmp/hi</tt> file and observe the results: 73 74 <div class="INFORMALEXAMPLE"> 75 <a name="AEN3434"></a> 76<pre class="SCREEN"> 77 <samp class="PROMPT">h4: {238} %</samp> <kbd class= 78"USERINPUT">lpc stop lp lp2</kbd> 79 Printer: lp@h4 80 lp@h4.private: stopped 81 Printer: lp2@h4 82 lp2@h4.private: stopped 83 <samp class="PROMPT">h4: {239} %</samp> <kbd class= 84"USERINPUT">lpr /tmp/hi</kbd> 85 <samp class="PROMPT">h4: {240} %</samp> <kbd class= 86"USERINPUT">lpq -a</kbd> 87 Printer: lp@h4 (printing disabled) 88 Queue: 1 printable job 89 Server: no server active 90 Rank Owner/ID Class Job Files Size Time 91 1 papowell@h4+659 A 659 /tmp/hi 3 08:04:03 92 Printer: lp2@h4 (printing disabled) 93 Queue: no printable jobs in queue 94 <samp class="PROMPT">h4: {241} %</samp> <kbd class= 95"USERINPUT">lpc move lp papowell lp2</kbd> 96 Printer: lp@h4 97 lp: selected 'papowell@h4+659' 98 lp@h4.private: move done 99 <samp class="PROMPT">h4: {242} %</samp> <kbd class= 100"USERINPUT">lpq -a</kbd> 101 Printer: lp@h4 (printing disabled) 102 Queue: no printable jobs in queue 103 Status: job 'papowell@h4+659' removed at 08:19:24.962 104 Printer: lp2@h4 (printing disabled) 105 Queue: 1 printable job 106 Server: no server active 107 Rank Owner/ID Class Job Files Size Time 108 1 papowell@h4+659 A 659 /tmp/hi 3 08:19:24 109</pre> 110 </div> 111 <br> 112 <br> 113 114 <p>We first stop the queues so that the jobs will remain in 115 them. We then use the <tt class="COMMAND">lpc move fromqueue 116 id toqueue</tt> command to select a job in the <span class= 117 "emphasis"><i class="EMPHASIS">fromqueue</i></span> and move 118 it to the <span class="emphasis"><i class= 119 "EMPHASIS">toqueue</i></span>. A list of job numbers, job 120 IDs, or glob patterns to match job IDs can be used to select 121 the job.</p> 122 123 <p>The <tt class="COMMAND">lpc redirect fromqueue 124 toqueue</tt> will cause all incoming jobs to be redirected to 125 the specified queue. You can execute the following commands 126 and observe the results.</p> 127 128 <div class="INFORMALEXAMPLE"> 129 <a name="AEN3452"></a> 130<pre class="SCREEN"> 131 <samp class="PROMPT">h4: {243} %</samp> <kbd class= 132"USERINPUT">lpc redirect lp lp2</kbd> 133 Printer: lp@h4 134 forwarding to 'lp2' 135 lp@h4.private: redirected 136 <samp class="PROMPT">h4: {244} %</samp> <kbd class= 137"USERINPUT">lpq -a</kbd> 138 Printer: lp@h4 (printing disabled) (redirect lp2) 139 Queue: no printable jobs in queue 140 Printer: lp2@h4 (printing disabled) 141 Queue: no printable jobs in queue 142 <samp class="PROMPT">h4: {245} %</samp> <kbd class= 143"USERINPUT">lpr /tmp/hi</kbd> 144 <samp class="PROMPT">h4: {246} %</samp> <kbd class= 145"USERINPUT">lpq -a</kbd> 146 Printer: lp@h4 (printing disabled) (redirect lp2) 147 Queue: no printable jobs in queue 148 Status: job 'papowell@h4+935' removed at 09:08:21.410 149 Printer: lp2@h4 (printing disabled) 150 Queue: 1 printable job 151 Server: no server active 152 Rank Owner/ID Class Job Files Size Time 153 1 papowell@h4+935 A 935 /tmp/hi 3 09:08:21 154</pre> 155 </div> 156 <br> 157 <br> 158 159 <p>To turn redirection off, use <tt class="COMMAND">lpc 160 redirect queue off</tt> as shown in the example below:</p> 161 162 <div class="INFORMALEXAMPLE"> 163 <a name="AEN3464"></a> 164<pre class="SCREEN"> 165 <samp class="PROMPT">h4: {247} %</samp> <kbd class= 166"USERINPUT">lpc redirect lp off</kbd> 167 Printer: lp@h4 168 forwarding off 169 <samp class="PROMPT">h4: {248} %</samp> <kbd class= 170"USERINPUT">lpq</kbd> 171 Printer: lp@h4 (printing disabled) 172 Queue: no printable jobs in queue 173 Status: job 'papowell@h4+935' removed at 09:08:21.410 174</pre> 175 </div> 176 <br> 177 <br> 178 </div> 179 180 <div class="NAVFOOTER"> 181 <hr align="LEFT" width="100%"> 182 183 <table summary="Footer navigation table" width="100%" border= 184 "0" cellpadding="0" cellspacing="0"> 185 <tr> 186 <td width="33%" align="left" valign="top"><a href= 187 "x3376.htm" accesskey="P">Prev</a></td> 188 189 <td width="34%" align="center" valign="top"><a href= 190 "index.htm" accesskey="H">Home</a></td> 191 192 <td width="33%" align="right" valign="top"><a href= 193 "x3470.htm" accesskey="N">Next</a></td> 194 </tr> 195 196 <tr> 197 <td width="33%" align="left" valign="top">Printing from 198 <b class="APPLICATION">lpr</b> Directly To A Device</td> 199 200 <td width="34%" align="center" valign="top"><a href= 201 "tutorial.htm" accesskey="U">Up</a></td> 202 203 <td width="33%" align="right" valign="top">Print Job 204 Classes, User Requested Job Priority, and Form 205 Support</td> 206 </tr> 207 </table> 208 </div> 209 </body> 210</html> 211 212