Hello fellow osf managers,
I apologies for the delay in posting this summary while I evaluated
the various scripts/ideas kindly submitted. I first must thank the
following people:
"Alexander, Robert" <Robert_Alexander_at_Tupmail.com>
"Partin.Kevin" <KPartin_at_hou.mdc.com>
"T. S. Horsnell" <tsh_at_mrc-lmb.cam.ac.uk>
Lucio Chiappetti <lucio_at_ifctr.mi.cnr.it>
Phil Farrell <farrell_at_pangea.Stanford.EDU>
Ralph Rodriguez <rrodrigu_at_ssc.wisc.edu>
Serguei Patchkovskii <patchkov_at_ucalgary.ca>
Tom Webster <webster_at_ssdpdc.lgb.cal.boeing.com>
alan_at_nabeth.cxo.dec.com
esci <esci_at_fastlane.net>
In my original posting I asked for advice on scratch disk policies. The
question arose from [certain] users defeating our simply 'find and remove'
command:
/sbin/find /u/scr1/ -type f -atime +14 -xdev -exec \rm -f {} \;
I received a number of suggested using various combinations of atime (last
accessed), ctime (last changed) and mtime (last modified) to identify
files to be removed from the scratch disk. All of which can be defeated.
And any solution will be CPU, I/O or storage space intensive.
I was particular pleased with two scripts submitted by fellow admins:
'cleanup.pl' by Serguei Patchkovskii <patchkov_at_ucalgary.ca> (attached to
the bottom of this poster) and 'prunedisk' by Phil Farrell
<farrell_at_pangea.Stanford.EDU> which can be obtained by contacting the
author.
Quoting from the 'cleanup.pl' documentation:
"Subdirectories are removed recursively if all of the files in the
subdirectories have all of atime, mtime and ctime older than $deadTime.
Notification e-mail is sent to the file owner. For directories with files
older than $warnTime, a warning e-mail is sent."
Meanwhile, from the man page of 'prunedisk':
"Prunedisk prunes specified directory tree, removing inactive files and
directories older than specified age, based on private database of file
ages that it maintains."
And, Phil comments "[the] script had the added benefit that it avoided
problems with incorrect deletion of files restored from tar tapes. With
the 'find' command, I would delete files that had not been modified within
15 days. But when you restore files from a tar tape, they are given their
original modification times, which are always more than 15 days ago. So
"find" would delete them the next night. My private database does not use
any of the time stamps stored with the file and deletes these files
instead 15 days after they are first seen on the disk."
In addition, Lucio Chiappetti <lucio_at_ifctr.mi.cnr.it> adopted an intricate
policy whereby users ran a specific program which records the duration and
location of directories created. Then a cron job changes ownership of all
files to root on a frequent basis followed by another cron job removing
the directories after the specified duration. Meanwhile Tom Webster
<webster_at_ssdpdc.lgb.cal.boeing.com> has adopted to be vigilant and "come
down heavy" on all users who abuse the scratch disk.
Once again, I thank everybody who replied and I hope this poster gives one
or two ideas to others.
-- cut --
begin 755 cleanup.pl.gz
M'XL(",[?L38"`V-L96%N=7`N<&P`Y5IM;]M&$OXL_8J)K%_at_22DM.VCNT3A,X
M<-I#_at_*87Q&G[X7HH5N1*XH7D*ES2KL[Q?[^9V1<N*<J.6^!PP"DO$G=W9N=M
MGYG=Y=&CQ:J4\EJ4<K%,B\56EMGP:'_at_$TXL9//GFFZ\C_.\;N)3ENI8IO!55
MO/F_at_KO2'-(U_at_:Y_.ZUAD:U'NYK%_at_XO>;5(..RW1;02P*6$I(4AU79;JL*YD`
M39GM8%NJJS3!YVHCJC.DPX^8P8\*5E("LH_at_WHES3>%5"6FEB8GBDBICN5$&T
M$_at_J5IX7(#`?\Y#))!<1*5\^H312)Z5K.X&VI4$<05<,()\I%(B-(BSBKD[18
M0R;%%7U7I$_at_NM19KZ;FG127B"K]X[J5*=J!6_-NH/&<;O,S6JDRK37[&C_#:
M#*_4]B235S)#94H95ZK<P51HM*769`D%QQ<X>_'*]<Y`9*S9*LVD!I4E*#X:
MK(!Q(D7R/LTEH/>_at_E+FZDLD<OD=C(4EK/-$;&O1T03016_at_7D22[2C`R_at_95'1
MY"2BNBZ0A`:2"5`U41!]FF]EP=;AJ40VIU;Z=UDOG3(I3AE(_at_]]Q7>KTBMR=
MKE_at_N:RL6C_D:P^_at_VDXVXDFZXJ%C_at_O&)=T><Q_2+:/FO,,8"J=)7&_at_KW;KZ,S
MJ%'6&"V<_AH]UV-Q;ST.*V^C]AS&_]X/>VR)H:Z,$BWNHHA3I`\F*.[7I-:R
MC"".Z;E4RL_.LF>X8-`+:.+';\0ZC:F5_9.N"U5BM#2BZK0B`3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-Y.2*OFA02^HIO"=V]>OOX!B]-/_*81O\O`
MSAI!ST%V68$?YK=+IB!F/M9X[G;.<_at_\X?5>6]%:#?64E9'/_at_`J?S/D)X*&`0
MS5=;YM_at_A?"O"CFB_$>%/'5C]B[__^/WKOT4CW#\T+P3TWE:&`YS,Y_9M`13A
M6\/I!;8:U<TS.<L%[M0-Q^"/-VK+IS5'0W]E7.9DDWJ++D-U84OZ]F\`_%+8
M9E2K!(R;FXB^ESD<05,SW0YU)N5V^N5I4%D>.;5>V#</O)#NEN>/2"4Q?.&F
H[PSP?ED!%PN$ARNF$_UP/FKD/K<76HURQTW)R]7\?P`=`3'L62<``"4Q
`
end
-- cut --
Regards,
Rich
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\
/_/ Richard A Bemrose /_\ Polymers and Colloids Group \_\
/_/ email: rb237_at_phy.cam.ac.uk /_\ Cavendish Laboratory \_\
/_/ Tel: +44 (0)1223 337 267 /_\ University of Cambridge \_\
/_/ Fax: +44 (0)1223 337 000 /_\ Madingley Road \_\
/_/ Mobile: +44 (0)410 168 873 / \ Cambridge, CB3 0HE, UK \_\
/_/_/_/_/_/_/
http://www.poco.phy.cam.ac.uk/~rb237 \_\_\_\_\_\_\_\
"Life is everything and nothing all at once"
-- Billy Corgan, Smashing Pumpkins
Received on Fri Jan 29 1999 - 17:53:46 NZDT