- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Moving Printers.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 07:13 AM
05-18-2006 07:13 AM
I have 311 printers to define on severs A, B, and C. The printers needing to be defined are already setup on an existing server,D. The problem I have is that I don't need to define ALL printers from server D to A,B, and C, just the specified 311. How would I accomplish this? Is it even possible?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 07:14 AM
05-18-2006 07:14 AM
Re: Moving Printers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 08:29 AM
05-18-2006 08:29 AM
Re: Moving Printers.
JETDIR=/opt/hpnpl
for MYPRN in /etc/lp/interface
do
MYHOSTIP=$(grep PERIPH= $MYPRN)
if [ $? -eq 0 ]
then
echo "$JETDIR/bin/addqueue -h $MYHOSTIP -q $MYPRN"
fi
done
If you do not have the hpnpl directory, change the first line to /opt/hpnp. The output of the above script contains the command line needed to add the printer on a new server. Just edit out the undesired printers and copy the resultant file to the new server.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 08:51 AM
05-18-2006 08:51 AM
Re: Moving Printers.
I did this few months ago to move about 105 printers from (11.11) to 11.23
so far now problems.
How to move all printers to another server DocId: KBRC00017466 Updated: 12/14/05 9:57:00 AM
PROBLEM
How to move all printers to another server?
RESOLUTION
HP does not support the copying of the lp spooler configuration from one system
to another. The following suggestions have been known to work in many cases.
If possible use SAM to create a backup of your printer configuration that
can be restored on another system, see document:
UPRTKBRC00014862 How to move the lp spooler configuration to another system
If SAM fails the spooler directories can be copied between systems of the
same OS version. If you have JetDirect network printers attached, ensure both
servers have JetDirect Printer Installer software installed.
On the source server, backup using tar, these directories:
/etc/lp/
/var/spool/lp
Example:
# lpshut
# tar cvf /tmp/etc_lp /etc/lp/*
# tar cvf /tmp/var_spool_lp /var/spool/lp/*
# lpsched
Use ftp in binary mode to copy the following files to your destination
server:
/tmp/etc_lp
/tmp/var_spool_lp
On the destination server, restore those directories after removing any
previous printer configurations:
# lpshut
# rm -r /etc/lp
# rm -r /var/spool/lp
# tar xvf /tmp/etc_lp
# tar xvf /tmp/var_spool_lp
# lpsched
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 09:26 AM
05-18-2006 09:26 AM
Re: Moving Printers.
This is the Doc, HP Sent Me
and this is the one, I followed
UPRTKBRC00014862
How to move the lp spooler configuration to another system
Document Information Table
How to move the lp spooler configuration to another system DocId: UPRTKBRC00014862 Updated: 12/1/04 7:44:00 AM
PROBLEM
How can the lp spooler configuration be moved or copied to another
system? Recreating each printer in the current configuration on the new system
requires a lot of effort..
RESOLUTION
HP does not support the copying of the lp spooler configuration from one system
to another. The IO configuration of the target system may be different than IO
configuration on the source system. The device files for local printers would
be different on the new system, and the spooler configuration for those
printers contain the device files. The print queues may not work.
A procedure that has been known to work in most circumstances is as follows :
On the source system:
Execute
-> SAM
-> Printers and Plotters
-> Lp Spooler
-> Save/Restore Spooler Configuration
Choose
-> Actions
-> Save Spooler Configuration
This will save all the information necessary to rebuild the spooler into the
directory /var/sam/lp.
Tar this directory (/var/sam/lp) :
# tar cvf /tmp/lp.tar /var/sam/lp
Copy the resulting tar file, lp.tar, onto the target system.
Unpack the lp.tar file on the target system :
# tar xvf lp.tar
Execute
-> SAM
-> Printers and Plotters
-> Lp Spooler
-> Save/Restore Spooler Configuration
Choose
-> Actions
-> Restore Spooler Configuration
This will build the lp spooler configuration on the target system using the
information from the source system, creating a "clone" of the old system.
If any source system print queues are network printers originally configured
using HP JetAdmin or HP JetDirect Printer Installer, then the
following must also be performed.
HP JetDirect Printer Installer must be installed on the destination
system.
Run the following command after restoring the printer/spooler
configuration through SAM:
# /opt/hpnpl/bin/transferqueue local
Enter the queue name or all to modify all the queues : all
NOTE: transferqueue changes several paths in the JetAdmin model scripts in
/etc/lp/interface/ and /etc/lp/interface/model.orig/ to point to the location
of the HP JetDirect Printer Installer product.
An error may occur when restoring the spooler if the root umask is set to
something other than 022. The permission on /var/sam/lp and all file
under it could be changed from their defaults, with the result that SAM cannot
access the files to perform the restore. The permissions on /var/sam/lp and the
files under it should be 755 or rwxr-xr-x, with the owner root and group
sys.
# ll -d /var/sam/lp
drwxr-xr-x 8 root sys 8192 Nov 29 15:45 /var/sam/lp
The error received in SAMlog would be something like:
ERROR A problem occurred doing
"lpadmin -ptrec_stor -i/var/sam/lp/interface/trec_st or -v/dev/null ".
Stderr from this command is
"/usr/sbin/lpadmin: can't access file "/var/sam/lp/interface/trec_stor"".
* Failed to restore trec_stor.
Another error that may occur, and has the same root problem, is:
ERROR A problem occurred doing
"lpadmin -pPRINTER -i/var/sam/lp/interface/PRINTER -v/dev/null ".
Stderr from this command is
"/usr/sbin/lpadmin: can't access file /var/sam/lp/interface/PRINTER"
* Failed to restore PRINTER.
A second way to resolve this particular error is to change the owner and group
of /var/sam/lp to lp and bin.
chown -R lp:bin /var/sam/lp
A better solution would be to set the proper permissions on the directory and
files with:
chmod -R 755 /var/sam/lp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 12:50 PM
05-18-2006 12:50 PM
Re: Moving Printers.
How should me list look, or be formated?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 12:56 PM
05-18-2006 12:56 PM
Re: Moving Printers.
/opt/hpnpl/bin/addqueue -h 12.34.56.78 -q lj4bay6
and so on. The documents listed above are used for a complete move--no editing. This would be necessary if oyu had a mix of local, remote and JetDirect printers. But since all your printers are JetDirect, the task is much simpler and you can edit the rsultant file before you add the printers to the new system.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 04:17 PM
05-18-2006 04:17 PM
Re: Moving Printers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-18-2006 04:37 PM
05-18-2006 04:37 PM
Re: Moving Printers.
#!/usr/bin/ksh
JETDIR=/opt/hpnp
for MYPRN in /etc/lp/interface
do
MYHOSTIP=$(grep PERIPH= $MYPRN)
if [ $? -eq 0 ]
then
echo "$JETDIR/bin/addqueue -h $MYHOSTIP -q $MYPRN"
else
echo "$JETDIR/bin/addqueue -h $MYHOSTIP -q $MYPRN"
fi
done
After I run the command, I get the following output:
root@D:/> ./ip_printer.sh
/opt/hpnp/bin/addqueue -h -q /etc/lp/interface
This lets me know that the if statement didn't return with the right code. I now assume that you were expecting the printer queue names to be the same as what the address defined in the config file in /var/sam/lp/interfaces directory? Please advise. I am in a time crunch now.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 12:24 AM
05-19-2006 12:24 AM
Re: Moving Printers.
I changed up the script a little to read from a list of the printers that I have:
#!/usr/bin/ksh
JETDIR=/opt/hpnp
for MYPRN in `cat /home/pw3483/tools/printers.txt`
do
MYHOSTIP=$(grep PERIPH= /var/sam/lp/interface/$MYPRN)
if [ $? -eq 0 ]
then
echo "$JETDIR/bin/addqueue -h $MYHOSTIP -q $MYPRN"
else
echo "$JETDIR/bin/addqueue -h $MYHOSTIP -q $MYPRN"
fi
done
Here is sample output:
/opt/hpnp/bin/addqueue -h PERIPH=192.168.1.28
PERIPH=$MODEL -q wiwiggp02
I can get rid of the first "PERIPH=" easily by doing a search and replace. The issue I am having now is keeping the PERIPH=$MODEL from showing up in the output at all. How can I accomplish that? This is how the output should look:
/opt/hpnp/bin/addqueue -h PERIPH=135.218.204.28 -q wiwiggp02
Please help!!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 12:38 AM
05-19-2006 12:38 AM
Re: Moving Printers.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 01:04 AM
05-19-2006 01:04 AM
Re: Moving Printers.
root@erie:/etc/lp/interface> head -20 4100bl07
#!/usr/bin/sh
# (c) Copyright 1992, 1993, 1994 Hewlett-Packard Company. All Rights Reserved.
# $Header: /users/hpnp/odyssey/repository/sh/hpnp.model.psh,v 1.18 1999/04/21 08:40:27 hpnp Exp $
#
# HP JetAdmin Utility for Unix, HP-UX Network Printer Control Script
#
# This script invokes the original model script from the
# subdirectory model.orig and pipes its output to hpnpf.
if echo $PATH | grep "/usr/bin" > /dev/null 2>&1
then
:
else
PATH=$PATH:/usr/bin
export PATH
fi
# Add bin to the path for systems with /bin
BTW, in my question above this one, how do I keep "PERIPH=$MODEL" from appearing in the output? I think if I could do that, this problem would be over.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 02:09 AM
05-19-2006 02:09 AM
Re: Moving Printers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 02:33 AM
05-19-2006 02:33 AM
Re: Moving Printers.
MYHOSTIP=$(grep PERIPH= $MYPRN)
to
MYHOSTIP=$(grep PERIPH= $MYPRN | grep -v MODEL)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 03:51 AM
05-19-2006 03:51 AM
Re: Moving Printers.
cd /var/sam/lp/interface
grep MODEL 4100bl07
to locate where MODEL is assigned. All we're doing here is to locate the printer's IP address. Show this item and then I can modify the script to obtain the hostname or IP address.
On the other hand, if you already have the local HP-UX print queues (the printer names) corresponding to either /etc/hosts or your DNS server (so that nslookup 4100bl07 will return an IP address), you have a much simpler task. Let us know.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 06:12 AM
05-19-2006 06:12 AM
SolutionPERIPH=myhostORip
PERIPH=$MODEL
However, the $MODEL line is not in column 1 so my script would be modified to:
JETDIR=/opt/hpnpl
for MYPRN in /etc/lp/interface
do
MYHOSTIP=$(grep ^PERIPH= $MYPRN | cut -d= =f2)
if [ $? -eq 0 ]
then
echo "$JETDIR/bin/addqueue -h $MYHOSTIP -q $MYPRN"
fi
done
There are two changes: one is the addition of ^ in front of the PERIPH= string to find only the line which has the IP address or IP assigned. The other is an oversight in the original script. $MYHOSTIP should contain only the text following the = sign so MYHOSTIP= now has a cut command at the end. This should produce a ready-to-use file, something like this:
/opt/hpnpl/bin/addqueue -h 12.34.56.78 -q 4100bl07
/opt/hpnpl/bin/addqueue -h 12.34.56.6 -q 4102bl08
/opt/hpnpl/bin/addqueue -h 12.34.56.123 -q 4132bl09
and so on. Just remove the printers you don't want to add from this file, transfer it to the new computer and the run it with: sh myfile
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2006 06:37 AM
05-19-2006 06:37 AM
Re: Moving Printers.
Between you two, I got what I needed accomplished!! Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2006 03:47 AM
05-26-2006 03:47 AM