Команда lpadmin
Configure the LP print service.
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 beginning wait 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 write quiet showfault none shell-command list |
| -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.) |
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.