AIXRestorePrinters

How to quickly restore printers

I have been asked to re-install an AIX machine "from scratch" (don't ask...) and, of course this machine had a lot of printers configured on it (again, don't ask... please).

Now, printer configuration is not something I like. As a matter of fact, if your UNIX machine does not use CUPS, it can be a real headache!

But, hey, you don't have to go through all the motions, provided you make a backup of the following files:

/etc/qconfig
/etc/qconfig.bin

Now, just to be precise: /etc/qconfig is the human-readable file, while /etc/qconfig.bin is the human-readable file mangled by smit or some other hellish AIX configuration utility.

WARNING You need a backup of the original printer configuration, or the printer configuration of an equivalent machine! Otherwise... You are out of luck!

The rest is pretty straightforward:

1. Check the backup for the printer configuration files:

For instance:

bash-3.2# tar tvf ./GALACTUS.backup_etc_20090826.tar /etc/qconf*
-rw-rw-r--   0 9    11666 Jan 19 19:26:39 2009 /etc/qconfig
-rw-rw----   0 9   153676 Apr 25 19:05:17 2009 /etc/qconfig.bin

2. Check the current configuration for the printer configuration files:

Kind of an optional step, but if the following files are not present, you probably should install the bos.printers.rte package which should be on the AIX installation CD 1 (but I haven't checked, so don't take my word for it):

bash-3.2# ls -alF /etc/qconf*
-rw-rw-r--    1 root     printq         1640 Jun 21 2004  /etc/qconfig
-rw-rw----    1 root     printq            4 Aug 31 08:38 /etc/qconfig.bin

3. Make a backup copy of the printer configuration files:

One can never have too many backup copies... ;-)

bash-3.2# cp /etc/qconfig /etc/qconfig.ORIG
bash-3.2# cp /etc/qconfig.bin /etc/qconfig.bin.ORIG

4. Restore the previous printer configuration files:

Pretty straightforward:

bash-3.2# tar xvf ./GALACTUS.backup_etc_20090826.tar /etc/qconf*
x /etc/qconfig, 11666 bytes, 23 media blocks.
x /etc/qconfig.bin, 153676 bytes, 301 media blocks.

You are done!

You can now check if all the printers are there with the lpstat or lpadmin commands, or through smit.

If necessary, you can also restart the lpd service, with the following command:

# refresh -s lpd

See Also:

Hope this helps!