Operating System - HP-UX
1833772 Members
2055 Online
110063 Solutions
New Discussion

Deleting queues in hp-ux B.11.23

 
SOLVED
Go to solution
Manuales
Super Advisor

Deleting queues in hp-ux B.11.23

Hi, how can i delete the configuration of 2000 printers? i mean the queue configuration.
I want to create a script but i am not sure where the configuration is created (paths, configuration files, etc) when a queue is added into the system.
Also i need to make a backup before deleting the configuration of all those 2000 printers.

Please give me suggeestions.
Note: i know that i can do it using sam but i need to create the script instead of delete one by one.
13 REPLIES 13
Dennis Handly
Acclaimed Contributor
Solution

Re: Deleting queues in hp-ux B.11.23

You can use SAM to make a backup.

You can use lpstat(1) to get a list of printers then loop on "lpadmin -xdest" to remove each one.
Manuales
Super Advisor

Re: Deleting queues in hp-ux B.11.23

I found this command:
removequeue -q dilbert -f

when this command is used, what configurations files are deleted? (what path? )
Manuales
Super Advisor

Re: Deleting queues in hp-ux B.11.23

Hi Denniss, if i use sam for the backup? what are the steps to do that? i have 4000 printers configured, i only need to delete 2000? can i do that manually?

Manuales
Super Advisor

Re: Deleting queues in hp-ux B.11.23


what is the difference in using below commands?

removequeue -q queuename -f

lpadmon -xqueuename
Dennis Handly
Acclaimed Contributor

Re: Deleting queues in hp-ux B.11.23

>if i use sam for the backup? what are the steps to do that?

Something to do with save and restore spooler config. Lots of threads about this:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1011463

>I only need to delete 2000? can I do that manually?

Do you have a list of them?
for printer in $(< delete-list); do
lpadmin -x$printer
done
Manuales
Super Advisor

Re: Deleting queues in hp-ux B.11.23

Hi Dennis
thanks a lot ..

i would like to know what directory paths are affected when i apply

lpadmin -x$printer

thanks.
Tim Nelson
Honored Contributor

Re: Deleting queues in hp-ux B.11.23

man lpadmin

FILES
/var/spool/lp/*
/var/adm/lp/*
/etc/lp/*
/usr/lib/lp/*

Manuales
Super Advisor

Re: Deleting queues in hp-ux B.11.23

thanks!!!
what is the difference in using below commands?

removequeue -q queuename -f

lpadmon -xqueuename
Bill Hassell
Honored Contributor

Re: Deleting queues in hp-ux B.11.23

> what is the difference in using below commands?

> removequeue -q queuename -f

This is part of the hppi package for HP JetDirect print interfaces. It is not designed for remote printers or direct-connect printers such as serial or parallel.

lpadmon -xqueuename

I believe you meant lpadmin -x and this is the lp spooler command to remove remote and direct-connect printers, but not HP JetDirect connections.


Bill Hassell, sysadmin
Manuales
Super Advisor

Re: Deleting queues in hp-ux B.11.23

Thanks a lot Bill..
could you please let me know what directories or files should i create a backup in case i need to recover some printer configuration?
James R. Ferguson
Acclaimed Contributor

Re: Deleting queues in hp-ux B.11.23

Hi Manuales:

> what directories or files should i create a backup in case i need to recover some printer configuration?

As Dennis suggested, use SAM. Look at the thread he referenced, for example.

Regards!

...JRF...
Bill Hassell
Honored Contributor

Re: Deleting queues in hp-ux B.11.23

When you delete a printer (lpadmin -x or removequeue), there are a few files that are removed, but some binary files in /var/spool/lp such as pstatus and qstatus are changed. There is no way to edit these files so if you wanted to restore one or two printers, replacing those status files would corrupt the spooling system.

Since recreating a printer is a simple one line command, before you delete a bunch of printers, you need to document all the printers starting with lpstat -v. For remote printers, you just need the 3 values: local queuename, remote server IP or hostname, and the remote printer name. For JetDirect printers, the local queuename and remote IP or hostname is all you need unless the printer is not connected. Then you'll need to provide the printer ID number. After collecting this into a couple files, you'll be able to recall a deleted printer in a few seconds of typing.


Bill Hassell, sysadmin
Manuales
Super Advisor

Re: Deleting queues in hp-ux B.11.23

Thanks all of you for your super help and support.