Operating System - HP-UX
1825805 Members
2573 Online
109687 Solutions
New Discussion

moving lp spooler configuration

 
SOLVED
Go to solution
Sunny Jaisinghani
Trusted Contributor

moving lp spooler configuration

Hello All,

I have a script which saves the the current lp configuration every day, archives the newly saved configuration and scp the .tar file to another standby print server and finally untar the archive over there.

here are my questions

1. the script saves the lp configuration by lpmgr. The directory is default LP_SAVE_DIR=$SAMROOT/var/sam/lp
However, when archiving they are archiving /etc/lp. Isn't this inappropriate. I do not see any link between these 2 directories. For reference i have attached a file with the listing of these 2 directories.

2. Is it necessary to stop the scheduler before we execute lpmgr -S?

3. Is it necessary to run lpmgr -R on standby server to make it operational as primary print server OR just extracting the tar file is OK.

4. If lpmgr -R is to be used which directory should be used /var/sam/lp OR /etc/lp?


These questions have arisen due to some differences in the script i have and the posts i have seen on the forum.

Would appreciate your replies

Thanks
Sunny


9 REPLIES 9
Sunny Jaisinghani
Trusted Contributor

Re: moving lp spooler configuration

Here is the attachment
Sunny Jaisinghani
Trusted Contributor

Re: moving lp spooler configuration

Hello All,

Need some help

Can anyone answer my questions..

Thanks in advance

Sunny
Dennis Handly
Acclaimed Contributor
Solution

Re: moving lp spooler configuration

>LP_SAVE_DIR=$SAMROOT/var/sam/lp

Instead of exporting this, you can use:
lpmgr -S (or -R) -xsavedir=dir

>when archiving they are archiving /etc/lp. Isn't this inappropriate.

lpmgr saves files from /etc/lp/ and /var/spool/lp/.

>2. Is it necessary to stop the scheduler before we execute lpmgr -S?

It doesn't seem like it. Only for -R.

>3. Is it necessary to run lpmgr -R on standby server to make it operational

Yes. lpsched doesn't know anything about /var/sam/lp.

>4. If lpmgr -R is to be used which directory should be used /var/sam/lp

The same value as where you saved it.

You could have figured this all out by viewing the sam log.
Tim Nelson
Honored Contributor

Re: moving lp spooler configuration

1. must archive the destination chosen with the -S /path/where/I/like/it ( typically /var/sam/lp e.g tar cvf /tmp/lp.tar /var/sam/lp)

2. NO

3. Must run lpmgr -R to execute the recovery (just sticking the files out there does nothing, or even breaks the current config)

4. lpmgr -R /path/where/I/like/it ( must be the path you untar'd stuff to but not /etc/lp/interface )

Example of the backup/restore

lpmgr -S /var/sam/lp
tar cvf /tmp/lp.tar /var/sam/lp
ftp /tmp/lp.tar to new system.
tar xvf /tmp/lp.tar
lpmgr -R /var/sam/lp

Done.. pretty simple.

Dennis Handly
Acclaimed Contributor

Re: moving lp spooler configuration

>Tim: lpmgr -S /var/sam/lp
>lpmgr -R /var/sam/lp

Both of these need: -xsavedir=/var/sam/lp
Sunny Jaisinghani
Trusted Contributor

Re: moving lp spooler configuration

What will happen if i only use the command

lpmgr -S OR lpmgr -R

Withour giving the -xsavedir switch

I guess it will copy the contents of /etc/lp and /var/spool/lp to the default directory; which will be /var/sam/lp

Am i right??
Dennis Handly
Acclaimed Contributor

Re: moving lp spooler configuration

>Without giving the -xsavedir switch
>I guess it will copy the contents of /etc/lp and /var/spool/lp to the default directory; which will be /var/sam/lp

(Or look at $LP_SAVE_DIR.) I would assume so but I would need to look at the script again.
Dennis Handly
Acclaimed Contributor

Re: moving lp spooler configuration

>default directory; which will be /var/sam/lp

Yes, that's the default.
Sunny Jaisinghani
Trusted Contributor

Re: moving lp spooler configuration

Thank you Denis and Tim