21.5 Managing Print Queues

   

Print queues are controlled by the lpsched process that runs as a daemon on your system. It is typically invoked by the /sbin/rc script at boot time. If the -v and -a options are used with this daemon, it writes its log data in the /var/adm/lp directory.

A print queue is a printer name or a class name , which either accepts print jobs at a particular time or not. Print queues may be enabled or disabled.

Starting and Stopping the Print Scheduler

To stop the print scheduler, use the following command.

 /usr/sbin/lpshut 

To restart the scheduler, use this method.

 /usr/sbin/lpsched 

Moving Print Jobs

Print jobs can be moved from one printer to another using the lpmove command. To move a print job LJ4-345 to a printer laser3 , you can use the following command.

 lpmove LJ4-345 laser3 

You can also use this command to move all print jobs from one printer to another. For example, to move all print jobs from printer laser1 to printer laser3 , use the following command.

 lpmove laser1 laser3 

This command can only be used when lpsched is not running. After using the command, printer laser1 stops accepting new print jobs.

Deleting Print Jobs

Print jobs can be deleted using the cancel command, which accepts a print job ID as its argument and cancels that print job. If, instead of a print job ID, you provide the name of a print queue, all requests on that print queue are canceled .

Enabling and Disabling Printers

To enable a printer, use the enable command. If the designated printer is a member of a class print queue, it starts printing jobs sent to that queue. If you disable a printer that is member of a class print queue, the requests are printed on another printer in the class. To enable and disable printer laserjet3 , you can use following commands.

 enable laserjet3 disable laserjet3 

If you use the -c option with the disable command, it will cancel all requests being printed on the designated printer. You can also use the -r option with a reason string with the disable command. This reason is reported with the lpstat command when checking the status of the printing system.

Accepting and Rejecting Print Requests

The lp command can send a request to a queue that is accepting print requests. For example, to temporarily disconnect a printer for maintenance, you may stop accepting requests for that printer. The reject command is used for this purpose. You can also specify a message that is displayed on a user screen if the user attempts to send a print job to a printer that is not accepting print requests. The command to reject requests for printer laserjet3 is as follows .

 reject -r "laserjet3 is temporarily out of order" laserjet3 

To start accepting print requests again, use the following command.

 accept laserjet3 

The enable and disable commands determine whether a printer will print requests sent to a queue, while the accept and reject commands determine whether a user can send a request to a printer.

Current Printer Status

The current status of the printing system may be checked using the lpstat command. If you use the lpstat command without any argument or option, it prints the status of all print jobs requested by the user. You can use the options shown in Table 21-2 with this command.

Table 21-2. Options Used with lpstat Command
Option Description
-a List the acceptance status of all printer queues
-c Write the class names and their members
-d Show the default system destination
-o Write the status of output requests
-p Write the status of printers
-r Write the status of the print scheduler
-t Write all status information
-u Write the status of a particular user

Study Break

Checking the Current Printer Status

Use the lpstat command to check the status of all printers configured on your system. Now use the reject -r command with a rejection response message for a particular printer. Try sending a print request to that printer. You should see the rejection message on your terminal screen.


   
Top


HP Certified
HP Certified: HP-UX System Administration
ISBN: 0130183741
EAN: 2147483647
Year: 2000
Pages: 390
Authors: Rafeeq Rehman

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net