On Thu, Jul 21, 2005 at 05:39:04PM +0100, Greig A Cowan wrote:
> > Ah and i was about to delete the pool to recover the space :)
> > Is there a reason why dcache doesn't delete the files automatically?
> > Do we have to go through the cleanup excercise manually or it was some random
> > failure in dcache?
> >
> > There are 1195 files in the trash :( i'll have to write some script i guess.
> > Do i delete the files from the trash after i run rep rm .... or dcache will
> > do something about it?
>
> I had started to write a set of scripts to remove files from a dCache
> pool, but then Owen S mentioned that someone (Judith Novak?) at CERN had
> already done this. Has there been any progress on finding out about this
> Owen?
Here is what i am running at the moment.
$ ./dcache_emptytrash > commands
$ ssh dcacheadm < commands
$ cat dcache_emptytrash
#!/bin/bash
trash=/opt/pnfsdb/pnfs/trash/2
pools="sedsk00_1 cmsdsk00_1 cmsdsk00_2"
cd $trash
for pool in $pools; do
pooldb[$pool]=`grep -sl $pool *`
done
for pool in $pools; do
echo "cd $pool"
for file in ${pooldb[$pool]}; do
echo "rep rm $file -force"
done
echo ".."
done
Cheers,
Kostas
|