|
Quick links About
lpadmin Syntax Examples
Related commands Linux / Unix main page
About lpadmin
Configure the LP print service.
Syntax
lpadmin [-p printer options] [-x dest] [-d [dest] ]
[-c class] [-D comment] [-e printer] [-h] [-F fault-recovery] [-S
print-wheel] [-i interface] [-l] [-I content-type-list] [ [-A
alert-type] [[-M] [-f form-name] [-a] [-o filebreak] [-t tray-number]]
[-m model]
| -p printer options |
Names a printer to which all of the options below refer. If printer does not exist then it will be created. |
| -x dest |
Removes destination dest from the LP system. If dest is a printer and is the only member of a class, then the class will be deleted, too. No other options are allowed with -x. |
| -d [dest] |
Makes dest, an existing destination, the new system default destination. If dest is not supplied, then there is no system default destination. No other options are
allowed with -d. |
| -c class |
Insert printer into the specified class. class will be created if it does not already exist. |
| -D comment |
Save this comment for display whenever a user asks for a full description of printer (see
lpstat). The LP print service does not interpret this
comment. |
| -e printer |
Copy the interface program of an existing printer
to be the interface program for printer. (Options -i and -m may not be specified with this option.) |
| -h |
Indicate that the device associated with the printer is hardwired. If neither of the mutually
exclusive options, -h and -l, is specified, -h is assumed. |
| -F fault-recovery |
This option specifies the recovery to be used for any print request that is stopped because of a printer fault, according to the value of
fault recovery:
continue
Continue printing on the top of the page where printing stopped. This requires a filter to wait for the fault to clear
before automatically continuing.
beginning
Start printing the request again from the beginning.
wait
Disable printing on printer and wait for the administrator or a user to enable printing again.
During the wait, the administrator or the user who submitted the stopped print request can issue a change request that specifies where printing should resume. (See the -i option of the
lp command.) If no change request is made before printing is enabled, printing resumes at the top of the page where stopped, if the filter allows; otherwise, the request is printed from the beginning. |
| -S print-wheel |
|
| -i interface |
Establish a new interface program for printer. interface is the pathname of the new program. (The -e and -m options may not be specified with this
option.) |
| -l |
Indicate that the device associated with printer is a login terminal. The LP scheduler (lpsched ) disables all login terminals automatically each time it is started. (The -h option may not be specified with this option.) |
| -I content-type-list |
Allow printer to handle print requests with the content types listed in a content-type-list. If the list includes names of more than one type, the names must be separated by commas or blank spaces. (If they are separated by blank spaces, the entire
list must be enclosed in double quotes.)
The type simple is recognized as the default
content type for files in the Unix system. A simple type of file is a data stream containing only printable ASCII characters and the following
control characters. |
| -A alert-type -W minutes |
The -A option is used to define an alert that informs the administrator when a printer fault is detected, and periodically thereafter, until the printer fault is cleared by the administrator. The alert-types are:
mail
Send the alert message using mail (see mail) to the administrator.
write
Write the message to the terminal on which the administrator is logged in. If
the administrator is logged in on several terminals, one is chosen
arbitrarily.
quiet
Do not send messages for the current condition. An administrator can use this
option to temporarily stop receiving further messages about a known problem.
Once the fault has been cleared and printing resumes, messages will again be sent when another fault occurs with the printer.
showfault
Attempt to execute a fault handler on each system that has a print job in the
queue. The fault handler is /etc/lp/alerts/printer. It is invoked
with three parameters: printer_name, date , file_name. The file_name is the
name of a file containing the fault message.
none
Do not send messages; any existing alert definition for the printer will be
removed. No alert will be sent when the printer faults until a different alert-type (except quiet) is used.
shell-command
Run the shell-command each time the alert needs to be sent. The shell
command should expect the message in standard input. If there are blank spaces
embedded in the command, enclose the command in quotes. Note that the mail
and write values for this option are equivalent to the values mail user-name
and write user-name respectively,
where user-name is the current name for the administrator. This will be the
login name of the person submitting this command unless he or she has used the su command to change to another user ID. If
the su command has been used to change the user ID, then the user-name for the new ID is used.
list
Display the type of the alert for the printer fault. No change is made to the
alert. |
| -M -f form-name [-a [-o
filebreak]] [-t tray-number]] |
Mount the form form-name on printer. Print requests that need the pre-printed form form-name will be printed on printer. If more than one printer has the form mounted and the user has specified any (with the -d option of the lp
command) as the printer destination, then the print request will be printed on the one printer that
also meets the other needs of the request.
The page length and width, and character and line
pitches needed by the form are compared with those allowed for the printer, by checking the
capabilities in the terminfo database for the type of printer. If the form requires attributes that are not available with the printer, the administrator is warned but the mount is accepted. If the form lists a print wheel as mandatory, but the print
wheel mounted on the printer is different, the administrator is also warned but the mount is accepted.
If the -a option is given, an alignment pattern is
printed, preceded by the same initialization of the physical printer that precedes a normal print request, with one exception: no banner page is printed. Printing is assumed to start at the top
of the first page of the form. After the pattern is printed, the administrator can adjust the
mounted form in the printer and press return for another alignment pattern (no initialization this
time), and can continue printing as many alignment patterns as desired. The administrator can quit the printing of alignment patterns by typing q.
If the -o filebreak option is given, a formfeed is inserted between each copy of the alignment pat-
tern. By default, the alignment pattern is assumed to correctly fill a form, so no formfeed is added.
If the -t tray-number option is specified,
printer tray tray-number will used.
A form is ``unmounted'' either by mounting a new form in its place or by using the -f none option.
By default, a new printer has no form mounted.
Note the other use of -f without the -M option above. |
| -m model |
Select model interface program, provided with the LP print service, for the printer. (Options -e and
-i may not be specified with this option.) |
Examples
Assuming a printer lp on a remote system system2, the command:
lpadmin -plp3 -v/dev/null -mrmodel -ocmrcmodel -osmrsmodel -ob3 -ormsystem2 -orplp -v/dev/null
causes the spool system to use the local line printer lp3 and the model rmodel. The spool system also uses the model rcmodel to cancel requests and rsmodel to get status from system2. In addition, the three-digit sequence numbers, the remote system name system2 and the remote printer lp are used.
Related commands
enable
lp lpstat
mail stty
|
|
| Resolved | Were you able to locate the answer to your questions? |
|
|