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.
To stop the print scheduler, use the following command.
/usr/sbin/lpshut
To restart the scheduler, use this method.
/usr/sbin/lpsched
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.
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 .
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.
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.
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.
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 BreakChecking the Current Printer Status
|
Top |