Linked by Thom Holwerda on Mon 28th Apr 2008 21:38 UTC, submitted by kiddo
Thread beginning with comment 312063
To read all comments associated with this story, please click here.
To read all comments associated with this story, please click here.
Ah! The UNIX solution. Which essentially means I'll lose my file dates (which is not a problem, but let's make it one
) OR I can't trash both net_programming.txt and .net_programming.txt without errors.
As is standard for UNIX solutions, it does not even solve the original problem, as rm still can't delete the files that were owned by root, and I can't touch them if they're owned by root either.
And of course there's "simple" ways around it, but come on, it's 2006!
No, it's actually 2008. I don't want to write a shell script to get my trash can working!
Edited 2008-04-30 20:15 UTC




Member since:
2005-07-06
First use incron to watch the .Trach folder and use touch on each file that is moved to .Trash
Then just run a cron script at regular intervalls that deltes old mail.
E.g
cd ~/.Trash;find . -amin +xxxx -exec rm -rf \{\} \;
where xxxx is how long time ago a file was last accessed.
The problem with this is that the files are touched and that their date information gets lost.
If you feel that this is a problem, you could let incron create a soft link preferably starting with a dot to make it invisible, and then modify the find script so that it removes both the link and the linked file when it is time. Don't forget to let incron handle deletion of the links in case a trached file is removed from the trash.