- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: deleting more than three days old print jobs
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
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
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
тАО09-09-2002 08:03 PM
тАО09-09-2002 08:03 PM
How to delete more than three days old print job? Is thery any command? Or Do I have to write shell script? If it is shell script means how to compare date?
Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2002 09:41 PM
тАО09-09-2002 09:41 PM
Solution1) file that start with "c..." (for example c6544venus)
2) file that start with "d..." (for example c6544venus)
The first one is a control file and the second one is the data file itself. So if you want to remove a specific print job you would simple delete these 2 files. In your case if you want to delete say all print jobs older than 3 days for printer name "laser5" for example , you would ..
# cd /var/spool/lp/request/laser5
# find . -type f -atime +3 -exec rm -f {} \;
Just one question, why 3 days ? In my opinion there should not be any files left in the spooler directory which are older than 1 day unless there are tons of print jobs which some can take up to a days before it got printed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-09-2002 11:03 PM
тАО09-09-2002 11:03 PM
Re: deleting more than three days old print jobs
Thanks for your reply. Great.
In find command should I use -mtime option? If I use -atime it only lists d* files. mtime option lists both c* & d* files.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-10-2002 02:44 AM
тАО09-10-2002 02:44 AM
Re: deleting more than three days old print jobs
Sure, you can use -mtime. However, I would caution that you check the file name as well. There are (or may be) some status files like .remotesending or .sendingstatus that should probably be left alone. Add a -name check to your find to look specifically for c* and d* files and you should be fine.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2002 02:40 AM
тАО09-11-2002 02:40 AM
Re: deleting more than three days old print jobs
simply deleting the files from /var/spool/lp/request/
Depending on the amount of spool you delete this way, it may result in having to wait 20 minutes before you can print anything after bouncing the spooler...
I know some of my users wouldn't be happy with this.
I suggest you create a shell script that does a "cancel <$printername>-<$number>", where $printername is the name of the queue you're inspecting (with find) and $number is the numbers in the filename cA1234servername of your spool file. This way you remove the spool properly.
regards,
Bart
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО09-11-2002 02:56 AM
тАО09-11-2002 02:56 AM
Re: deleting more than three days old print jobs
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2002 07:28 AM
тАО12-19-2002 07:28 AM
Re: deleting more than three days old print jobs
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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2002 07:31 AM
тАО12-19-2002 07:31 AM
Re: deleting more than three days old print jobs
I've got one idea for you - start a new thread.
Refer back to this one by cutting and pasting the URL, if you wish, but adding on to this one, which already has the "magic answer" bunny is not going to be as fruitful.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2002 07:32 AM
тАО12-19-2002 07:32 AM
Re: deleting more than three days old print jobs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2002 07:37 AM
тАО12-19-2002 07:37 AM
Re: deleting more than three days old print jobs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2002 07:38 AM
тАО12-19-2002 07:38 AM
Re: deleting more than three days old print jobs
#!/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:57 AM
тАО12-19-2002 07:57 AM
Re: deleting more than three days old print jobs
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-19-2002 08:11 AM
тАО12-19-2002 08:11 AM
Re: deleting more than three days old print jobs
#!/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
done