Adding printers remotely from the command line

John E. Vincent cups-bugs at lusis.org
Tue Sep 14 08:33:01 PDT 2004


Hi all.

I've been attempting to script the addition of multiple printers to our cups servers for a while. The best I've got so far is a perl script that generates a shell script of lpadmin commands. I transfer that file to each of our cups servers and use ssh to execute it remotely.

It's not the most efficient method. I'd really like to do it with php and integrate it into our existing web application for managing config and shipment of print servers in our retail locations.

I've attempted to use lpadmin from a remote host but it doesn't seem to work properly (i.e. lpadmin -h prodcups01 -p ColorPrinter -E -v socket://10.10.0.41:9100 -P /usr/share/ppd/HP/HP-LaserJet_4300-Postscript.ppd.gz -L ColorPrinter -D "HP LaserJet 4300").

The next option was to attempt to POST the ?op=admin url of a full add printer request. This didn't work either.

I compiled the php module for cups and looked at the examples but this really just looks to be an IPP interface.

I'm really down about this. Can anyone provide any insight as to the best method? When you're adding 50-100 printers daily to two cups servers (active/passive failover), the web interface just does NOT work.

Thanks.
John E. Vincent




More information about the cups mailing list