[K12OSN] scripting trash removal

Mike Ely mely at rogueriver.k12.or.us
Sun Jan 29 20:05:54 UTC 2006


Toshio Kuratomi wrote:
> 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

That's a good point.  However, the vast majority of users do not use 
their Trash (or Recycle Bin) correctly at all.  I'm sure many in here 
can recount numerous times where they found a user with a couple of gigs 
of general rubbish in their trash.  Most people delete stuff and never 
ever empty.  Yeah, there was that one lady who freaked when I emptied 
her trash (it's almost a nervous habit for me when sitting down at a 
desktop).  Apparently she was actually using it as a folder to store 
stuff.  D'oh!

Mike




More information about the K12OSN mailing list