21.1 Introduction to the Printing System

   

A printing system in HP-UX is collectively called the LP spooler. It is a collection of programs and utilities that are used to manage print requests and to make sure that each print request is printed separately. It is also responsible for ensuring that any printed matter be identifiable with whoever sent the print request.

A functional printing system offers the following capabilities to its users.

  1. submitting a print request

  2. checking the status of a print request

  3. making changes to a print request

  4. canceling a print request

An administrator of the printing system can accomplish the following tasks .

  1. add a new printer

  2. remove an existing printer

  3. enable and disable printers

  4. add printer classes

  5. change priorities of print jobs

  6. set fence priorities that don't allow a print request to go to a printer having a priority less than a defined value

  7. define a system default destination

  8. check the status of printers and print jobs

  9. move print jobs from one printer to another

A printer system is controlled by a scheduler daemon ( lpsched ). This daemon is started at boot time and manages print requests, scheduling them according to priority.

Sending a Print Request

A print request is sent using the lp command. You can use the -d option with the lp command to specify a destination printer name. If the destination is an individual printer, the print request goes directly to that printer. However, you can also send a print request to a class of printers. A class is a collective name for printers of the same type. For example, all HP laser jet printers of the same type may be included in one class. When you send a print request to a class of printers, the first available printer in the class prints it. Usually printers of one class are physically located close to each other so that a user may find output at one location, no matter which printer is used to print it. To print the .profile file in your home directory on a printer named LJ4 , you can use the following command.

 $  lp -dLJ4 ~/.profile  Request ID is LJ4-345 (1 file) $ 

When you submit a print request, the lp command will return a request ID that will be used later on for tracking your print job. This number will be of type LJ4-345 , where the first part ( LJ4 ) is the printer name and the second part ( 345 ) is a sequence number.

If you don't use a destination with the lp command, the spooler system checks for a LPDEST environment variable. This variable defines your destination printer name or class for the print job. In case this variable is not present, the default queue is checked. If there is no default queue and the LPDEST variable is not defined, an error message is printed.

Other options that can be used with the lp command are shown in Table 21-1.

Table 21-1. Option Used with the lp Command
Option Description
-c Copy the file being printed to the spool directory. If this option is not defined, the file is not copied to the spool directory. Instead, the file is read when the printing starts. It may happen that you submit a job and there is a large amount of print requests already queued. If your print job's turn comes after one hour and you have made changes to the file by that time, the new file will be printed instead of the one that was present at the time of sending the print request. So it is better to use this option as soon as you submit the print request so that the file is copied to the print queue.
-d Defines the destination printer name or printer class.
-m Sends a mail message to the user when the job is printed.
-n Sets the number of copies to be printed. By default, one copy is printed.
-p Sets the job priority: 0 is the lowest priority and 7 is the highest. The default priority is set by SAM or the lpadmin command.
-t Print a title on the banner page. A banner page is the first page of the printed output. You can use a title of your own choice. By default, the user login name is printed.
-w Write a message on the user's terminal screen when the job is finished. If the user is not logged in, a mail message is sent.

Canceling a Print Request

You can cancel a print request using the cancel command. The cancel command needs a request ID as its argument. To cancel the print job LJ4-345 , you can use the following command.

 cancel LJ4-345 

The cancel command can also be used to cancel print requests of a particular user, requests on a local printer only, or requests on a specified printer only. See the manual pages for more detail on the cancel command. If you cancel a print request that is currently being printed, the remaining part of the request is canceled and the printer starts the next print job.

Modifying a Print Request

You may need to modify a print request. The modification is made using the lpalt command. This command takes a print request ID as its argument. You can use the same options used with the lp command to alter a print request. For example, the following command sets the number of copies to three for the print job LJ4-345 .

 lpalt LJ4345 -n3 

You can also use this command to change the priority of a job if your job is urgent and is currently at the end of a long queue.


   
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