CUPS: Questions about printjobs in the queue

Hallo

Cups Version: 1.3.9

I receive a big list with 399 lines after typing in this command: lpstat -o
Here’s an example:

chchi06lb002-144622 edec 2048 Mon 24 Nov 2014 12:27:01 PM CET chzrh05lb080pdf-275077 edec 50176 Fri 15 May 2015 01:37:01 PM CEST chzrh05lb080pdf-275078 edec 30720 Fri 15 May 2015 01:37:01 PM CEST chzrh05lb080pdf-275665 edec 75776 Mon 18 May 2015 08:20:01 AM CEST chzrh05lb080pdf-275666 edec 34816 Mon 18 May 2015 08:20:01 AM CEST

[LIST]
[]How can I delete one of this queued jobs? (from all the different printers queues)
[
]How can I delete all of the queued jobs older than 2 months?
[/LIST]

Thanks for the help

This looks promising for you, though it’s a Python script. I"m sure you
could port it to be purely Bash-based, but then again using this may be
much faster:

https://www.mnxsolutions.com/quick-tip/cups-purging-not-completed-print-jobs-older-than.html


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

Thank you very much!

Hm, I never used a python script but it looks like python is installed on the server. Maybe I’ll give it a try…
Is there no other way to do it? Even if it’s more complicated… For example to clean certain old queues just on one printer.

Google finds lots of hits. This one seems useful regarding cleaning
printer-specific queues:

http://structbio.vanderbilt.edu/comp/hw/lprm.php

this too:

http://www.computerhope.com/unix/ulprm.htm

The time-based part is the area for the Python script, and again you could
create or find something else, but something needs to understand and use
times. In the script’s case, Python reads stuff, understands time,
understands user desires, and applies the commands appropriately via the
usual system commands. If lprm has an option to understand times in some
way, that’d be neat too, but I do not know that it does, and the manpage
does not seem to hint much at that. Nothing about lpq or cancel seem to
indicate understanding there either.


Good luck.

If you find this post helpful and are logged into the web interface,
show your appreciation and click on the star below…

[QUOTE=ab;29754]Google finds lots of hits. This one seems useful regarding cleaning
printer-specific queues:

http://structbio.vanderbilt.edu/comp/hw/lprm.php

this too:

http://www.computerhope.com/unix/ulprm.htm[/QUOTE]
I googled it by my self but I misunderstood the command lpq -PChDbsl20lb001. I didn’t realize that “P” is part of the parameter (even even though this should be clear because of the -) :slight_smile:
After reading the page above, everything was clear - thanks!

[QUOTE]The time-based part is the area for the Python script, and again you could
create or find something else, but something needs to understand and use
times. In the script’s case, Python reads stuff, understands time,
understands user desires, and applies the commands appropriately via the
usual system commands. If lprm has an option to understand times in some
way, that’d be neat too, but I do not know that it does, and the manpage
does not seem to hint much at that. Nothing about lpq or cancel seem to
indicate understanding there either.[/QUOTE]
Yes, you’re right. I think I’ll go with the script.

Thanks for the help and wise words!

Ambiguous Solutions help organizations to transform their ideas digitally. We implement our technically improved work strategies to provide the best software solution and services. We dig deep in a variety of services of online digital space. Be IT, web and mobile-based applications, interactive websites, UI/UX solutions or intricate development services in USA, UK, UAE, Australia, India. we have discovered that each successful solution is based on a thin line of dedicated and unique efforts. We always prefer to become our client’s partner not their vendors as we want to work as a team. We believe that working together will help us to develop incredible products for our clients. Our services include web development, android/IOS services, Creative branding, e-Commerce solution and many more.

Ambiguous
Ambiguous Web Development
Ambiguous App Development
Ambiguous Software Testing
Ambiguous Contact Us
Why choose us
Pokemon Past Future