SUMMARY : Deleting old print jobs

From: Niall O Broin (nobroin@sced.esoc.esa.de)
Date: Fri Oct 23 1998 - 02:31:45 CDT


Well that generated some interest and a lot of suggestions, some of
them even useful :-) For those of who came in late, I needed to delete
old spooled print jobs, so I needed a way of finding files which are
> XX minutes old. Nobody had a fully correct shell solution, because
I can't ignore times around midnight (the ground stations could be in
use at any time, and the machines are all set to Zulu time so midnight
is relative ;-) ) and I can't ignore the possibility of files being
24/48 . . hours and some minutes old either.

Kevin Sheehan's (I gather from the address that you've left Oz now ?)
suggestion of using

date "+%y %M %d %H %M"

whose output could be used with awk to get a "Julian minutes :-)" type
of value made me realise that I could do it with a pure shell solution
but it just sounded like a drag - having got that value, I'd need to get
it for each spooled file, so I'd need at least a table driven conversion
from ls -l output's three character month names to a month number and
then I'd have to handle files > 6 months old, where the ls -l output
changes format (surely that wouldn't happen, I hear you say. Well, there
could be jobs spooled and then there might be a problem with the Sun WS
and it might be replaced by a spare and then brought back into service
some considerable time later and . . . - yes, I'm paranoid, and if you
worked here, you would be too :-) )

To cut a long story short, there were some suggestions involving gdate
which can apparently generate a drifted date output, but the prize goes
to Michael Wang (mwang@tech.cicg.ml.com) whose succinct answer was
 
gnu's find -mmin option

If I've to install something besides my script, I might as well use the
solution which maximally simplifies my script. What's galling is that I
use gnu find everyday - it's in my /usr/local/bin which is early in my path.
However, it's been here forever i.e. I didn't install it and I didn't know
it was GNU find and its bloody man page isn't here, so whilst re-reading
find's man page for a solution I of course didn't come across this.

So, now I just have to implement it !

Thanks Michael, and to the other valiant attempts from

Aaron Lineberger <aaron@pinn.net>
Peter Polasek <pete@cobra.brass.com>
Jochen Bern <bern@penthesilea.uni-trier.de>
Rich Kulawiec <rsk@gsp.org>
u-kevin@megami.veritas.com (Kevin Sheehan - Uniq)
Mark Greenhalgh <Mark.Greenhalgh@mdmnetwork.com>
Daniel Lorenzini <lorenzd@gcm.com>
Karl Vogel <vogelke@c17mis.region2.wpafb.af.mil>

Kindest regards,

Niall O Broin

UNIX Network Administrator nobroin@esoc.esa.de
Ground Systems Engineering Department Ph./Fax +49 6151 90 3619/2179
European Space Operations Centre, Darmstadt, Germany



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:12:51 CDT