- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Finding oldest print job
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 08:06 AM
12-19-2002 08:06 AM
I scripted a report that shows me the number of print jobs stacked up in our queues and how many of those are more than a day old. It's a nice report to get every morning to show general print server health.
What I'd really like to do is get a report of the one oldest job in each queue. If it's older than [whatever] days I can forward the list to our System Support department so they can investigate with our branches why their jobs aren't getting printed.
I've investigated using the find command on /var/spool/lp/[queue#] and lpstat options and it still eludes me.
Any ideas?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 07:40 AM
12-19-2002 07:40 AM
Solution#!/usr/bin/sh
cd /var/spool/lp/request
PRINTERS=$(ls -1)
for P in PRINTERS
do
cd $P
OLDESTPAIR=$(ls -t c* d* | tail -2)
echo "Oldest files in $P are $OLDESTPAIR
cd ..
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 07:46 AM
12-19-2002 07:46 AM
Re: Finding oldest print job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 07:47 AM
12-19-2002 07:47 AM
Re: Finding oldest print job
I told you this would work better - you got Patrick's answer 26 minutes before you asked the question. Now that's service!!!
Is that going to do it for you?
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-19-2002 08:09 AM
12-19-2002 08:09 AM
Re: Finding oldest print job
Thanks for accepting the suggestion.
Can you attach your existing script. That might be a good starting point.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2005 01:40 AM
04-27-2005 01:40 AM
Re: Finding oldest print job
We now do a find on the lp spool directory and cull the job number from the c-file name and basically rebuild the job number from the filenames, then xarg a cancel command to it. I managed to do it in one line. Here's the command. It cancels all jobs older than 14 days. We skip queue q0500. It's our VsiFax queue.
find /var/spool/lp/request/*/cA* -mtime +14 -exec ll {} \; | awk -F / '{print $6,$7}' | grep -v cannot | grep -v q0500 | sed 's/ cA/-/g' | cut -b 1-10 | xargs cancel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2005 02:45 AM
04-27-2005 02:45 AM
Re: Finding oldest print job
lpstat -o |grep -v bytes|awk '$5ne"$M"{print $1}'|xargs cancel
That way I delete anything not in the current month - I run it on the 21st...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2005 02:48 AM
04-27-2005 02:48 AM
Re: Finding oldest print job
M=`date +%b`
Or just in oneline:
lpstat -o |grep -v bytes|awk '$5ne"`date +%b`"{print $1}'|xargs cancel
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2005 03:00 AM
04-27-2005 03:00 AM
Re: Finding oldest print job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2005 03:06 AM
04-27-2005 03:06 AM
Re: Finding oldest print job
A perl script that will check the requests and send email for any print jobs over X hrs old.
Make a cron to run this daily/weekly/monthly and get the results.
Attached perl script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-27-2005 03:22 AM
04-27-2005 03:22 AM
Re: Finding oldest print job
Very nice...
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-11-2005 07:15 AM
05-11-2005 07:15 AM
Re: Finding oldest print job
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2005 06:54 AM
10-19-2005 06:54 AM