<< Back to man.ChinaUnix.net

26.10. Saving the Configuration File

When the printer configuration is saved using the Printer Configuration Tool, the application creates its own configuration file that is used to create the files in the /etc/cups/ directory. You can use the command line options to save or restore the Printer Configuration Tool file. If the /etc/cups/ directory is saved and restored to the same locations, the printer configuration is not restored because each time the printer daemon is restarted, it creates a new /etc/printcap file from the Printer Configuration Tool configuration file. When creating a backup of the system's configuration files, use the following method to save the printer configuration files.

To save your printer configuration, type this command as root:

/usr/sbin/system-config-printer-tui --Xexport > settings.xml

Your configuration is saved to the file settings.xml.

If this file is saved, it can be used to restore the printer settings. This is useful if the printer configuration is deleted, if Red Hat Enterprise Linux is reinstalled, or if the same printer configuration is needed on multiple systems. The file should be saved on a different system before reinstalling. To restore the configuration, type this command as root:

/usr/sbin/system-config-printer-tui --Ximport < settings.xml

If you already have a configuration file (you have configured one or more printers on the system already) and you try to import another configuration file, the existing configuration file is overwritten. If you want to keep your existing configuration and add the configuration in the saved file, you can merge the files with the following command (as root):

/usr/sbin/system-config-printer-tui --Ximport --merge < settings.xml

Your printer list then consists of the printers you configured on the system as well as the printers you imported from the saved configuration file. If the imported configuration file has a print queue with the same name as an existing print queue on the system, the print queue from the imported file will override the existing printer.

After importing the configuration file (with or without the merge command), you must restart the printer daemon. Issue the following command as root:

/sbin/service cups restart