Cups importing/exporting

Dustin codyw725 at yahoo.com
Fri May 25 13:16:14 PDT 2007


Kurt,

All of the 80 servers do use the same print que because all of them are administered here by me, so if a remote location in another state is having an issue I can administer it, or if there is something I am doing here and I want to print it off for someone, I can select the printer in their location print it off, and just call them and let them know its on the printer for them, saves on email time.  The script was something I created, but the variables such as the import and export were features provided by the cups website for version 1.1 and I have been unable to find any for version 1.2.  I am sure I could do it all in about 8-10 hours, but I dont want to do that if possible, cause like I said all 80 remote servers are administered by me so I have a lot on my place.:-)  I think I will just take a look into a bit more and if I cant find any other info I will just have to donate some of my schedule to doing this manually.  Thanks for the help




> > 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