How do I limit the size of CUPS log files?

To reduce the size of the CUPS logs:

Back up the existing configuration settings:

cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.`date +%Y%m%d.%H%M%S`

Open the /etc/cups/cupsd.conf configuration file in your favorite editor (i.e. vim, nano, Gnome editor, etc.).

Locate the MaxLogSize setting, and change it to a smaller value. For example, 100 MB:

MaxLogSize 100m

Restart the CUPS print service to apply the changes:

service cups restart

Are there any CUPS settings that I can change to keep my Linux print queues from going down?

The default CUPS (Linux print spooler) settings have been shown to be reliable for Eclipse legacy printing at over 100 customer locations. In nearly all instances where print queues are consistently “going down,” a wide area network (WAN) issue has been proven to be the root cause. While working to resolve long-term networking issues, here are a few useful settings that can be adjusted to increase the amount of time allowed by CUPS before disabling a print queue

Timeout

The Timeout directive controls the amount of time CUPS will wait before an active HTTP or IPP request times out. The default timeout is 300 seconds (5 minutes), but this can be increased by modifying the /etc/cups/cupsd.conf configuration file, per the example below (1200 seconds or 20 minutes):

Timeout 1200

Maximum Job Limit

The MaxJobs directive controls the maximum number of jobs that are kept in memory. Once the number of jobs reaches the limit, the oldest completed job is automatically purged from the system to make room for the new one. If all of the known jobs are still pending or active then the new job will be rejected.

In a real-world scenario, if there is a printer down with a very large number of jobs in its queue this setting could cause printing to stop functioning server-wide. For this reason, and to ensure there are no hidden hardware or network issues, it is important to periodically monitor the number of jobs in the print queues (using the lpstat or similar tools).

If you regularly submit more than a few hundred jobs at one time to a print queue, you may wish to increase this setting in /etc/cups/cupsd.conf, taking care not to raise it too high to avoid system crash or spooler filesystem from filling up from an out of control print job.

By default, CUPS limits the number of active jobs at any one time to 500, but this can be increased to a larger value or be disabled entirely by setting the value in /etc/cups/cupsd.conf to 0 per the example below:

MaxJobs 0

Resources

http://www.cups.org/documentation.php/doc-1.3/ref-cupsd-conf.html

How do I manage Linux print queues?

View a step-by-step screencast of this process:

To administer print jobs, first log into the server as root before running any of the following commands.

UniVerse Spooler Commands

  • To view the status of a UV print queue:
usa -p lp1
  • To enable a UV print queue:
usa +o -p lp1
  • To manually start the UV spooler:
cd /u2/uv
bin/usd /usr/spool/uv -t
    • To cancel print jobs from the UV Spooler:

For a specific job number:

usm -k 12345

For an entire queue:

usm -k -p lp1

Linux (CUPS) Spooler Commands

  • To view the status of all print queues:
lpc status
  • To check the status of a single print queue and view a list of pending jobs:
lpc status lp1
lpstat -P lp1
lpstat -plp1
  • To remove a single print job:
cancel lp1-1234
  • To remove all print jobs in a queue:
cancel -a lp1
  • To enable  a queue:
cupsenable lp1
  • To disable a queue:
cupsdisable lp1
  • To enable all queues:
lpstat -p | grep disabled | awk '{print $2}' | xargs cupsenable
  • To print a test job:
echo test | lpr -P lp1
  • To restart/refresh the cups service:
service cups restart

Resources