310 likes | 441 Vues
This guide covers the essentials of printer and log file administration using the Common Unix Printing System (CUPS) and log management. It details the processes of setting up, managing, and troubleshooting printers as well as administrative tasks related to log files. Learn how to create print jobs, manage queues, and configure printers effectively. It also provides insights into log file structure, the syslog daemon, and efficient log file management practices. This resource is crucial for administrators aiming to optimize printing operations and maintain robust logging systems.
E N D
Printer and log file administration Unit objectives • Set up, manage, and use printers • Understand the purpose of log files and how they’re administered
Common Unix Printing System (CUPS) • Creates Print Job • File • Several files • Command output continued
Common Unix Printing System (CUPS) • Print job • The lp command • specifies what to print • Common Unix Printing System (CUPS) • assigns print job a unique print job ID • places a copy of the print job into the print queue, provided the printer is accepting requests continued
Common Unix Printing System (CUPS) • Once in queue, job is ready for printing • with printer disabled, cups prints an error message, leaves job in queue • with printer enabled, cups sends job to printer, deletes job from queue continued
Printer administration, continued • Spooling • Accepting jobs into the print queue • /var/spool/cups • Printing • Sending jobs from queue to printer
Printer commands • See details about line printing system • lpstat –t • See list of all printers on system and status • Status commands • accept printer1 • Set printer1 to accept jobs • disable printer1 • set printer1 to not print • Jobs will go into queue, but not print • -r will sent message to users
LPD Printing System • Older systems still use Line Printing Daemon (LPD) • Commands • lpr- print documents to print queue (like lp) • lpc-view status of printers • lpq-view print jobs in a queue • lprm-remove jobs, like cancel command
Managing print jobs • lp –d printer1 /etc/inittab • Sends a copy of the /etc/inittab file to printer1 • -d lets you specify printer name • lpoptions command • lpoptions –d <printername> • Stored in /etc/cups/lpoptions file • Also PRINTER or LPDEST variables
lp command options • See page 11-7 • Can send multiple files • Can pipe to lp command • lpstat • See print jobs you have queued
Managing print jobs • Removing jobs • cancel p1-1 p1-2 • Use the cancel command with print job IDs • Restricting usage • lpadmin –u allow:root, user1 –u deny:all –d printer1 • Deny everyone but root and user1
Configuring printers • cups daemon (cupsd) • Core printing component • Accepts jobs to queue and sends them to the printer • /etc/cups/cupsd.conf • Contains settings for cupsd • /etc/cups/printers.conf • Contains configuration for each printer • NOTE: • Printers are physical devices on the network or attached to a machine. However, we often refer to the queue name as the printer and vice versa. However, a printer can have multiple queues
Post Creation • Print a test file • Settings can be edited through GUI
What is a log file • Log files • Contain information about the performance of system daemons • Appended by system daemons • /var/log • The directory that contains most log files
The system log daemon • System log daemon (syslogd) • Logs system events to various log files via information stored in /etc/syslog.conf • Creates /dev/log for daemons to write to • Syslog.conf format • facility.priority /var/log/logfile
The system log daemon • Facility • Refers to the area of the system from which information is gathered • Priority • Importance of system information when logging system events
Managing log files • Don’t remove log files • But they do get big! Make a copy, or printout • Use a redirect to empty them out • logrotate command • Used to rotate log files • /etc/logrotate.conf • Used by the logrotate utility to specify rotation parameters for log files • How many logfiles…
Managing log files • /etc/logrotate.d • More detailed log rotation information • logrotate is usually run by cron • Can manually run • logrotate logrotate.conf
Unit summary • Set up, managed, and used printers • Learned about log files and how they are administered