[K12OSN] scripting trash removal

Toshio Kuratomi toshio at tiki-lounge.com
Sun Jan 29 20:02:29 UTC 2006


On Fri, 2006-01-27 at 13:22 -0500, Mark Gumprecht wrote:
> Dave was nice to send me this for clearing cache
> 
> !#/bin/bash
> for x in `ls /home`; do
> echo "Doing $x ..."
> cd /home/${x}/.mozilla/firefox/*.default/Cache
> rm -Rf *
> done
> 
> Ok that works just fine. Soooo, If that works for cache, with a little 
> mod like this
> 
> !#/bin/bash
> for x in `ls /home`; do
> echo "Doing $x ..."
> cd /home/${x}/.Trash
> rm -Rf *
> done

You've probably already considered this but just in case:

Deleting cache files should be relatively transparent to an end-user (It
affects their performance somewhat but they shouldn't lose data.)
Deleting the contents on .Trash is unexpectedly circumventing the way
the Trash works (to be able to recover deleted files.)

If you hadn't already considered that, you might want to implement aging
of the Trash (like the tmpwatch program for /tmp) or user quotas (so the
user has to empty the Trash themselves in order to stay under quota.)

-Toshio
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://listman.redhat.com/archives/k12osn/attachments/20060129/f7359625/attachment.sig>


More information about the K12OSN mailing list