-   Linux - Software (
-   -   cups - deleting print jobs (

mikejd 11-09-2004 04:39 AM

cups - deleting print jobs
I have a problem with aborting print jobs when running cups.

My distro is Mandrake 10.0 and the current printer is an Epson Stylus Photo, but I also have Epson Stylus C62 and Canon BJ20 installed. I sometimes have to abort a print job, most often because I have not set the correct printer and the print-out is garbage. (The Stylus Photo is set to default but this doesn't always seem to work)

I have tried deleting the print job using 'localhost:631' and in Webmin. Turning the printer off then back on does nothing, it just starts to print again as soon as it's switched back on. Presumably the job is still being spooled. I have tried (as 'root') deleting files in /var/spool/cups/ to no avail. The only thing which works is to reboot.

Is there any simple way, short of rebooting, which will enable me to remove the files from the print queue? I would like, if possible, to set up a script which I can run from a Desktop icon to automate this.

otoomet 11-09-2004 05:52 AM

I am not quite sure about cups, but try command 'lprm'.

Perhaps it helps.


mikejd 11-09-2004 06:57 AM

I get a message 'Unable to cancel jobs'

I tried to print a file with the printer switched off. Tried to cancel with 'lprm' - didn't work. Opened Webmin and Cups Printer Management (localhost:631), deleted job in Webmin, Cups showed no jobs. Switched on printer and it printed the file. It must be using /var/spool/cups as files have been added here, but I'm not sure what needs to be deleted. Any suggestions welcome.

theYinYeti 11-09-2004 07:14 AM

You can use the gtklp program. It comes with two binaries:
- gtklp: the GUI properties (like xpp).
- gtklpq: print queue administration.

All in gtk, and working good for me.

Of course, you can also try the HTTP interface. I don't like it, but it should work.


mikejd 11-09-2004 10:22 AM

I've now tried this package with the same result. The print jobs are obviously being sent to a spool and deleting them from the print queue does not stop them being printed.

theYinYeti 11-10-2004 04:06 AM

Maybe the problem you have is not with the computer's spool, but with the printer's. The printer also has memory. On my Epson, when I delete the currently printing job, I also have to clear the current job from the printer's memory. There's a key-combination for that, which I always forget, or I simply power-off, then on the printer.


[edit:]For the record, I found the key-combination again for the clearing the Epson Stylus Color 900 memory spool: you have to double-click the power-on button, which on this model does not halt&restart the printer, but clear the spool instead :)[/edit]

mikejd 11-10-2004 08:54 AM

Thanks for the suggestion. I don't however think this is the answer as I have tried this to no effect before.

To test it, I have just sent a print job to the printer with it switched off. I then deleted the job in both CUPS Admin (localhost:631) and in Webmin. So no jobs were then queued. Switched the printer on and it printed the file. I assume the file could not have been in the printer memory as it was not switched on when the job was sent. I'm guessing here but it seems to me it must be spooled somewhere..

I've had this problem for so long now, and tried posting to various forums without success, that I guess I'll just have to live with it.

mikejd 11-10-2004 09:09 AM

More information which may or may not help :

Checked /var/spool/cups, last file was c00029
I tried printing a file with the printer OFF.
Webmin showed a queued job ID 30, CUPS admin showed queued job ID 30.
Checked /var/spool/cups/ files c00030 and d00030-001 had been added.
Deleted job in Webmin, CUPS admin showed no jobs queued.
Checked /var/spool/cups/ and file d00030-001 had been deleted.
Deleted file c00030 to be sure.
Switched on printer and it printed the file.

Question : where is the file being sent in addition to /var/spool/cups/ ??

theYinYeti 11-15-2004 04:47 AM

If this is really bug'ing you, then maybe you could try and make a diff (and have a walk while it is done)...
This is a VERY LONG process:
1) boot at the lowest runlevel you can (maybe 1 then start network & cups) with as little mounts as possible.
2) mount a partition with much spare space at an odd location:
mkdir /MyDumps
mount /dev/hdxx /MyDumps
mkdir /MyDumps/OLDSYS
mkdir /MyDumps/NEWSYS
3) take a snapshot of the system before printing.
(cd / && tar cf - --exclude=/MyDumps .) | (cd /MyDumps/OLDSYS && tar xpf -)
you'll have to check --exclude usage; I've never used this option.
4) print a single page of simple text, while the printer is off.
5) take a snapshot of the system after printing.
(cd / && tar cf - --exclude=/MyDumps .) | (cd /MyDumps/NEWSYS && tar xpf -)
you'll have to check --exclude usage; I've never used this option.
6) compare.
cd /MyDumps
diff -r OLDSYS NEWSYS >SYS.diff

Reboot into your usual environment and study the resulting SYS.diff file. (Of course, you can remove the empty /MyDumps dir when nothing is mounted on it anymore.)


naps 11-15-2004 05:09 AM

I had a similar problem once which was sorted by deleting a lockfile, but I cannot remember the details.

se7ensnakes 01-31-2007 11:03 AM

where are the spooled files?
I have had the same problem.
I have an Epson dot matrix printer for printing three part forms and sometimes i accidently send a 200 page document to it.
I tried using lprm but lpq is not showing any pending jobs.
So where does it go?
I have had this problems for years......
during that time i had found a solution......unfortunately once i solved the problem at that time, i did not bother to note the file and when the problem occurs again a year later...... i cannot remember what i did a year ago.
Usually by restarting the computer it eliminates the problem but at the moment i have tried this and the 1000 page print job which i am trying to delete continues printing. The problem is clearly in Linux spooling........although this only happens to certain printers. It does not happen with my Hewlett Packard laser printers.

amitzsekali 05-15-2007 08:48 AM

solution to inability to kill job queue in linux
I hope the original poster see this, it's been years..

fuser -k /dev/lp0

do the above as root.

All times are GMT -5. The time now is 03:18 AM.