Cups importing/exporting

Kurt Pfeifle kurt.pfeifle at infotec.com
Fri May 25 12:47:44 PDT 2007


> Kurt,
>
> Thanks for the reply.  I am using FC6.

I don't know which *exact* CUPS version FC6 uses (and, honestly, I'm too lazy to google for it).

> I am not getting confused here, but maybe just didnt do a good job at
> explaining my issue.

:-)

> I have about 80 servers that are being used as cup servers.  I want to
> upgrade them to version 1.2.

1.2.11 is the latest version.

> I want to load the package of all the printers (about 90 printers in total) to each server with the upgrade of the new version.

Are you saying that each of the 80 servers has the same set of 90 printqueue?

Or are you saying that each of the 80 servers has a few printqueues (some of which may overlap in between some servers), and these queues are sending jobs to 90 different printers?

> On version 1.1 it use to have a script that you could use that would
> allow one server to export the printers and the other server to import
> them, all done automated.

So who gave you that script?

> With version 1.2 I cant find this and what I dont want to do is have
> to log onto all 80 servers, mostly because they are in different
> states, to add the printers.

Well, if you have ssh access (preferrably, "passwordless", using a key file) for root on all 80 servers, it is just a little bit of work to write a little set of small scripts that do the following:

  (1) retrieve all current printqueue info from a specific server
       -- the "lpstat -v" command gives you a list of printqueue names and their respective backends
       -- the /etc/cups/ppd/ directory holds the driver information
          for all printqueues; create a tar archive for them
       -- (take separate care for cases where you have "raw" queues, or
          ones which use and "interface" script)
       -- create a script that uses these commands and collects the
          relevant info
  (2) delete all current print queues on a server
  (3) update to CUPS 1.2.11
  (4) re-install the printqueues again, based on the info which was
      collected by the scripts from (1)

My guess is that you need about 1 day / 8 hours to create (and test!) the scripts, and 80 minutes to finally run the scripts via ssh, and another day to check if all servers and their queues are working as expected.

The benefit of that work is that you can re-use it for future CUPS software updates, or future re-creating the print server (hardware failure, anyone?)


BTW, if all 80 servers do allow CUPS client access from your current location, this command will create a list of the printer information from remote (you sitting in front of a CUPS client in a different state):

   lpstat -h remote_cups_server -v | tee remote_cups_server.printer.list

This command will create a list of printers on your remote CUPS server:

   lpstat -h remote_cups_server -p | awk '{print $2}' | tee remote_cups_server.printer.names

These command will retrieve one/all PPDs from the remote server:

   for i in $(cat remote_cups_server.printer.names); do \
          wget -r 1 -c -nd http://remote_cups_server:631/printers/${i}.ppd \
   done

If you leave away the "-nd" command to the wget command, you'll get nice local subdirectories structure for each remote server with the printernames/PPDs inside each (instead of all PPDs the flat current directory).

With this command:

   lpadmin -h remote_cups_server -v <whatever-info-you-got-via-(1)> -P printername.ppd

you can then remotely install the queues again. Of course you wanna script this too...

> Is there any type of utility that can help me accomplish this?

I don't know of any ready-made one. But you can do it yourself; or hire someone to do it for you...

Cheers,
Kurt

--
Kurt Pfeifle
System & Network Printing Consultant ---- Linux/Unix/Windows/Samba/CUPS
Infotec Deutschland GmbH - A RICOH Company .......... Stuttgart/Germany





More information about the cups mailing list