[pca] keeping proxy area pruned

Martin Paul martin at par.univie.ac.at
Fri Aug 15 17:38:37 CEST 2008


> what policy are people using to keep the spool area of the proxy server 
> pruned?

I usually keep everything, especially the READMEs. As I do have cheap 
scratch space for the pca proxy, I'm not forced to clean it up.

> My first thought would be to purge all older versions of specific 
> patches, ie in the case of:

Here's a simple shell script I've used for this very task in the past:

#!/bin/sh

test -d BAK || mkdir BAK

set `ls [0-9][0-9][0-9][0-9][0-9][0-9]-*`

f=$1
shift

while test $# != 0
do
   p1=`echo $f | cut -c 1-6`
   p2=`echo $1 | cut -c 1-6`
   if test $p1 = $p2
   then
     echo mv $f BAK
     mv $f BAK
   fi
   f=$1
   shift
done

It moves all but the most current revision of each patch into a BAK 
directory, which you can then delete. Just run the script now and then, 
and you'll see that used disk space won't grow as fast anymore.

Another option would be to run "ls -t | tail -1000" to get a list of the 
1000 files which have not been accessed for the longest time, and remove 
those.

> would be handy if pca-proxy.cgi could be configured to do some 
> housekeeping tho (maybe purging obsolete patches too).

I've thought about it, but it never seemed important enough to actually 
implement it, esp. as one solution won't fit everybody.

Martin.



More information about the pca mailing list