1833758 Members
2333 Online
110063 Solutions
New Discussion

Adding printers

 
SOLVED
Go to solution
EJ Stremler
Frequent Advisor

Adding printers

We are switching to new hardware and HP-UX 11.23 in our future production environment.. In our current production, there are about 320 printers that were defined as network printers through Jet Direct... Is there any way that I can get around not having to add these printers manually? Can I copy over the /etc/lp/interface directory, and if so what other directory structures have to be copied over? Any help would be appreciated..Thanks, Ed..
10 REPLIES 10
Geoff Wild
Honored Contributor
Solution

Re: Adding printers

Like this:

echo "Backing up the spooler configuration to /var/sam/lp/lp.new....please wait..." ; /usr/sam/lbin/lpmgr -S -v -xsavedir=/var/sam/lp/ ; cp -r -p /var/sam/lp/lp.new/* /var/sam/lp/


tar cvf lp.tar /var/sam/lp/

scp that tarbal to new server.

tar xvf lp.tar

echo "Restoring the spooler configuration....please wait..."; /usr/sam/lbin/lpmgr -R -xsavedir=/var/sam/lp/

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Bill Hassell
Honored Contributor

Re: Adding printers

lpmgr should work assuming that the other system is fairly recent. If the old box is running 11.00 or older (like 10.20), I would be concerned about printer script compatibility with the latest version of hppi. The alternative is to make a list of the printers on the old box, then create a simple script to add each printer to the new system. A very little known command is addqueue (from the hppi package). All that is needed is the IP address and the name to be used for the local queue:

addqueue -h 12.34.56.78 -q myprn234


Bill Hassell, sysadmin
EJ Stremler
Frequent Advisor

Re: Adding printers

Thank you all for your valiable input.. I have a couple questions.. Is running lpmgr -S goring to create a new directory in /var/sam/lp/lp.new? Can I tar up the /var/sam/lp/lp.new instead and scp it over to the new system? I need to get the configuration from a production machine, so i just want to make sure that this will not effect any other printer configuration.. thanks again...Ed..
Geoff Wild
Honored Contributor

Re: Adding printers

/var/sam/lp isn't used by the running spooler so it is safe to over write.

For some reason, if you just use /var/sam/lp/lp.new, it won't restore.

That's why I do the mv then tar it up.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
EJ Stremler
Frequent Advisor

Re: Adding printers

Hi Geoff - I see, so when you do the restore on the new system with lpmgr -R , then it populates /etc/interface, and /var/spool/lp, etc which are used by the spooler?.. thanks again - ed
Geoff Wild
Honored Contributor

Re: Adding printers

Ed, that's right - it puts all the printer definitions in those dirs.

I hav'nt done it for some time, but I believe you have to shut the spooler down before you do the restore.

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
EJ Stremler
Frequent Advisor

Re: Adding printers

Shutting the scheduler down first with an lpshut? Then re-starting the scheduler with lpsched? thanks again Geoff..Or I can do all this within SAM? ed
Geoff Wild
Honored Contributor

Re: Adding printers

Yes lpshut, then lpsched -v

I prefer the command line :)

Rgds...Geoff
Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
EJ Stremler
Frequent Advisor

Re: Adding printers

Geoff - Just to let you know on one of our DEV systems I tried the "Save Spooler Configuration" through SAM, and it updated the /var/sam/lp directory, I checked the samlog and no indication of the scheduler being shut down, which makes me feel more comfortable using SAM on the existing production system. I found SAM generally stops from doing things that are not supposed to be done.. Although many other situations I do prefer using the command line.. I think when the restore of the spooler is done on the new system, SAM will shut the scheduler down, but there i don't care because there are no printers defined yet.. I will let you know, and thanks again.. Ed..
EJ Stremler
Frequent Advisor

Re: Adding printers

All worked like a charm and the 350 printers are now defined on the new servers by: saving the spooler configuration, copying /var/sam/lp to the new server, and then restoring the configuration.. Thanks for all your help and valuable information... Ed