Operating System - HP-UX
1838497 Members
2662 Online
110126 Solutions
New Discussion

Re: Printer Synchronization

 
Jon Schneider_1
Advisor

Printer Synchronization

Ok...here is what I have and I am not having luck finding information about it.

We have 3 clusters set up on 6 partitions between to 9000s (i think they are 9000s, i could be wrong). Anyway, we have created like 25 printers and need to keep them synchronized between the partitions. I am thinking that a perl script or sh script would suffice, and I am sure someone else has run into this problem before, and would love to see how they handled it as opposed to using sam to create/modify/maintain a current 25 printers six times as opposed to the greatly increased number when our application finally gets rolled out to all 9 locations.

Thanks in advance,

Jon
Thank you, sir! May I have another!?
11 REPLIES 11
A. Clay Stephenson
Acclaimed Contributor

Re: Printer Synchronization

This is actually rather easy:

Setup all the printers on the "master" host.
Do an lpstat -t and look for any old/hung jobs and cancel them -- no point in copying that over. Now do an lpshut.
cd /
find ./var/spool/lp ./etc/lp -print | cpio -ocv > /var/tmp/lp.cpio
lpsched

Now on each of your other hosts:
ftp or rcp the /var/tmp/lp.cpio file from the master.
lpshut

cd /
find ./var/spool/lp ./etc/lp -print | cpio -ocv > /var/tmp/lp.cpio.save # just to be safe
cpio -icvdum < /var/tmp/lp.cpio
lpsched

Now all your printers should be in sync. You must also make sure that all the printer hostnames are correctly resolved but DNS/LDAP/ or NIS/NIS+ makes that easy. I also assume that you have installed the JetDirect software (if needed) everywhere.

This approach is rather easy to script as a bunch of remsh's.



If it ain't broke, I can fix that.
Jon Schneider_1
Advisor

Re: Printer Synchronization

Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you! Thank you!

This looks like it will solve my problem! I am going to test it very soon!

Thank you!

Jon
Thank you, sir! May I have another!?
Geoff Wild
Honored Contributor

Re: Printer Synchronization

Why have printers configured on all clusters at all? Why not setup a printing package on one of the clusters - and point all servers to it instead. That's what I do...

If you insist on copying between servers, here's another method:


/usr/sam/lbin/lpmgr -S -v -xsavedir=/var/sam/lp/
cp -r -p /var/sam/lp/lp.new/* /var/sam/lp/

Then tar up /var/sam/lp/, copy to other servers, un tar it on them and:

/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.
Jon Schneider_1
Advisor

Re: Printer Synchronization

Each cluster serves a different purpose in its own separate environment...one is production, one is test (for pristine testing has to mirror production) and the final is D/R, which of course has to stand on its own.
Thank you, sir! May I have another!?
Geoff Wild
Honored Contributor

Re: Printer Synchronization

Similiar to my environment - I have a Prod Cluster, a QA one - but test is non clustered.

I have test print to Prod cluster (as well as some other non clustered production apps)

My QA has it's own print spool - and I use the method I posted above to update once a month.

For DR - my QA system becomes Prod - with SRDF...

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.
Jon Schneider_1
Advisor

Re: Printer Synchronization

Ok...the first method acted like it was doing it but didn't update the remote printer name. The second method just told me that /etc/lp/member is empty. This was done in sam with HP Distributed Print Service if that means anything.

Thanks,

Jon
Thank you, sir! May I have another!?
Jon Schneider_1
Advisor

Re: Printer Synchronization

Ok...i got the /var/opt/pd folder and copied it to the new server...but sam doesn't seem to take it. Any ideas?
Thank you, sir! May I have another!?
Geoff Wild
Honored Contributor

Re: Printer Synchronization

Are you using the native LP spooler or "HP Distributed Print Service"?

My method was for the native spooler....

Sounds like you are in fact using HPDPS...

http://docs.hp.com/en/B2355-90156/index.html

Sorry - not familiar with it.....

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.
Jon Schneider_1
Advisor

Re: Printer Synchronization

yeah...using hpdps
Thank you, sir! May I have another!?
Geoff Wild
Honored Contributor

Re: Printer Synchronization

Found this:

"The DCE Extended Environment

In the DCE Extended Environment, HPDPS objects (such as physical printers and spoolers) created by any member of a DCE cell are instantly available to the entire cell. For example, if a new physical printer is created within a DCE Extended Environment server, the name of the new physical printer is visible to every client in the DCE cell, and each client can immediately issue HPDPS operations for that physical printer. This is possible because the entire cell shares the same namespace called the DCE Cell Directory Service. This allows for single-point administration as a result of the distributed namespace. See Chapter 8. Managing DCE Security for HPDPS for more information on the DCE Extended Environment. "

Sounds like you should be using that...


Got it from:

http://docs.hp.com/en/B2355-90678/index.html

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.
Dave Hutton
Honored Contributor

Re: Printer Synchronization

Just another way of doing this. You can use transferqueue if you have the JetDirect Printer Installer for UNIX installed.

It's man page gives a real good example of how to use it. It's pretty easy and pretty simple.