Obtaining the PPD file from a local and a remote CUPS server

The compressed PPD files on a local CUPS server are located in:

/usr/share/cups/model/

The used PPD files by CUPS server are located in:

/etc/cups/ppd

If your printer is on a remote CUPS server, you can easily download the PPD file to your client with

wget http://server_name_or_IP:631/printers/printer_queue_name>.ppd

Continue reading “Obtaining the PPD file from a local and a remote CUPS server”

Install CUPS printer on Windows machine

The IPP is the native protocol of CUPS: Therefore no extra daemon is needed to receive IPP print jobs. The CUPS daemon listens for IPP requests on port 631. Port 631 is the default port for the IPP. Depending on its configuration it also accepts SSL-encrypted IPP, usually on the SSL-port 443. IPP clients can be other machines running Windows, GNU/Linux, Unix, or MacOS X with CUPS.

On the Windows computer, go to Control Panel->Devices and Printers and choose to ‘Add a printer’. Next, choose ‘Select a shared printer by name’ and type in the location of the printer:

ipp://hostname:631/printers/printer_queue_name

CUPS – printer in a stopped state

CUPS introduced an Error Policy which puts the CUPS printer into a stopped state when physical printers experiences an error, such as, paper jam, out of paper, paper tray open, etc. The CUPS printer does not change to an idle or ready state even after the physical problem is resolved, and the reason for this is not to drop print jobs or to send them to a printer that is not responding. The administrator must go to CUPS Web Administration or a command line to change the printer out of the stopped state. To prevent this situation change the CUPS ErrorPolicy to retry-job:

1. Enter this command at a terminal session while logged in as root:

root# /usr/sbin/lpadmin -p -o printer-error-policy=retry-job

2. Per printer – open the /etc/cups/printers.conf and find the printer that you wish to modify, and chang the ErrorPolicy entry from stop-printer to retry-job

<Printer "PrinterName">
...
ErrorPolicy retry-job

3. Globally change – open the /etc/cups/cupsd.conf and look for ErrorPolicy, if you find it, change the entry from stop-printer to retry-job.
If you do not find that entry, add the following at the end of the file:

ErrorPolicy retry-job

Or use the script below with a cron, which will automatically enables printers on a CUPS printing server:

#!/bin/sh
#
# Check if the printers are disabled and enable them.

DISABLED=`lpstat -t | grep disabled | awk ‘{ print $2 }’`

for PRINTER in $DISABLED
do
logger “Printer $PRINTER is stopped”
cupsenable -h 127.0.0.1:631 $PRINTER && logger “Printer $PRINTER has been enabled.”
done

CUPS – /var/spool/cups file beginning with "d" and "c"

File beginning with “d”
The files whose names begin with a “d” are temporary files for active print jobs. These files contain the actual data of the file to be printed in whatever format as PostScript, text, PDF, etc. By default, these files should be removed approximately 30 seconds after a print job is completed, canceled, or aborted.

Files beginning with “c”
The files whose names begin with a “c” are “job history” files. They are retained until explicitly removed by an administrator with the CUPS cancel command.
The numeric portion in the names of both types of files is the print job number associated with the file. So, for example, the file /var/spool/cups/d19170 is the print data file associated with print job 19170, and the file /var/spool/cups/c19170 is the job history file for that same print job.

root# ls -lah /var/spool/cups/
--cut
-rw------- 1 root lp 821 Apr 13 08:52 c19169
-rw------- 1 root lp 819 Apr 13 08:53 c19170
-rw------- 1 root lp 819 Apr 13 08:54 c19171
-rw-r----- 1 root lp 276M Apr 13 08:07 d19170-001
drwxrwx--T 2 root lp 4096 Jan 16 10:16 tmp
root#