5.3 The command line interface

The CLI of CUPS is lpadmin and the editing of /etc/cups/cupsd.conf. While you can do everything using lpadmin and editing /etc/cups/cupsd.conf, the web interface if far more interactive and intuitive. This is not to say that the CLI interface is useless. The CLI interface is particularly useful when you need to change configurations using a script.

For example, you may want to disable a printer at a certain time of the day. You can use crontab in conjunction with lpadmin to accomplish this. lpadmin is flexible enough to only block access to the printer from a certain IP address range, or allow access from another IP address range.

As mentioned in the previoua paragraph, the CLI of CUPS allow very fine grain access control that is not available via the web interface. If you have a complicated printer access policy to implement the CLI is far more suitable than the web interface.

Another good example if when you are the administrator of a network of lots of workstations. Instead of going to each workstation and use the web interface to configure the local settings, you can distribute a script to do so.

Note that it is generally safer to use lpadmin than to edit the contents of /etc/cups/cupsd.conf directly. This is because manual editing the XML file can introduce syntax errors and inconsistencies.