Managing the APSS cups/samba print queues from the command line:

I have written a perl script that can be used to quickly reinitialize the print queues for the departmental network printers. It first clears away all print jobs on all the queues and then reenables them all.
As root you can run it as follows:

# /home/adm/fixprintqueues.pl

In addition I have it scheduled to run each day at 5:23AM which should get each day started well.
There is a possability of a user's job being lost at 5:23AM if someone is printing exactly at that time but he or she should soon realize that it didn't print and try again.
Check the job status with lpstat, if there are no jobs printing then just run fixprintqueues.pl to reinitialize the queues.

If something happens during the working day the fillowing commands are useful:

# /usr/bin/lpstat -t  # reports the state of all queues
# /usr/sbin/cupsenable <queuename> # starts the indicated queue
# /usr/sbin/cupsdisable <queuename> # stops the indicated queue
# ps | lp -d <quename> # send a one page test to the queue
After sending that test quickly do # tail -f /var/log/messages to observe whether or not it printed.

If it has not printed then it may be necessary to visit the printer.

In the past it was sometimes necessary to remove this samba file for a queue.
First disable it.
Then remove the samba tlb file (i.e. "rm /var/cache/samba/printing/<queuename>.tlb"
Then reenable it.

There may be bugs in this so let me know if something doesn't work.


Bill Szkotnicki, 2008/March