|
|
Auto-empty-trash after (say) six months
|
|
|
|
Mac Elite
Join Date: May 2001
Location: Manchester, UK
Status:
Offline
|
|
One feature I love in Mail.app is the delete trashed messages after a specified period - one week in my case. I would like a similar behaviour for the main Trash in the Finder. After, say, six months, files are properly deleted.
I like to be quite liberal in what I throw away in the Trash, but I tend to empty it only every few months, just in case. This of course means that some recently-trashed stuff is lost. I like the idea of an automatic buffer system. If you haven't needed a file in six months, you probably don't need it. This would keep the Trash relatively empty.
Can this be achieved. Applescript?
|
|
|
|
|
|
|
|
|
Professional Poster
Join Date: Sep 2000
Status:
Offline
|
|
smart folder + an applescript that moves everything to the trash?
-r.
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Aug 2005
Location: fairbanks AK
Status:
Offline
|
|
Originally Posted by philm
One feature I love in Mail.app is the delete trashed messages after a specified period - one week in my case. I would like a similar behaviour for the main Trash in the Finder. After, say, six months, files are properly deleted.
I like to be quite liberal in what I throw away in the Trash, but I tend to empty it only every few months, just in case. This of course means that some recently-trashed stuff is lost. I like the idea of an automatic buffer system. If you haven't needed a file in six months, you probably don't need it. This would keep the Trash relatively empty.
Can this be achieved. Applescript?
i suggest compost. i like version 1.2.
|
Earth First! we'll mine the other planets later.
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status:
Offline
|
|
1. make a applescript to empty the trash
2. use cron to have it run every 6 months.
done!
|
I free'd my mind... now it won't come back.
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jun 2003
Location: Newport News, VA USA
Status:
Offline
|
|
Originally Posted by RevEvs
1. make a applescript to empty the trash
2. use cron to have it run every 6 months.
done!
But then say if cron kicked it off tomorrow, it would delete files he just dropped in there today. If you re-read his original post he wants files that have been in the trash for six months to be deleted, not the trash to be emptied every six months.
Smart folder + AppleScript would probably be the way to go here.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2001
Location: Manchester, UK
Status:
Offline
|
|
Originally Posted by cybergoober
But then say if cron kicked it off tomorrow, it would delete files he just dropped in there today. If you re-read his original post he wants files that have been in the trash for six months to be deleted, not the trash to be emptied every six months.
Smart folder + AppleScript would probably be the way to go here.
cybergoober: you are exactly correct, this is what I want. I will try the Smart Folder, although I might need to redirect cmd-delete to put files into this Smart Folder rather than direct to the Trash. Cheers.
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: May 2001
Location: Manchester, UK
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status:
Offline
|
|
Originally Posted by cybergoober
But then say if cron kicked it off tomorrow, it would delete files he just dropped in there today. If you re-read his original post he wants files that have been in the trash for six months to be deleted, not the trash to be emptied every six months.
Smart folder + AppleScript would probably be the way to go here.
ah yes, wasnt paying attention
|
I free'd my mind... now it won't come back.
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Jan 2001
Location: Helsinki, Finland
Status:
Offline
|
|
Originally Posted by philm
cybergoober: you are exactly correct, this is what I want. I will try the Smart Folder, although I might need to redirect cmd-delete to put files into this Smart Folder rather than direct to the Trash. Cheers.
I was thinking you could attach a folder script to the trash can, which re-routes files into your 'Smart Trash' folder. This way, the behavior would be universal, so that when apps move files to the trash, that works too. However, as a symptom, trash from other disk volumes would likely end up being copied into one volume.
Later, your smart folder eventually deletes the files directly, without using the trash can.
J
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Dec 2001
Location: Land of Enchantment
Status:
Offline
|
|
Downloaded Freaky Trash Manager and, it is freeeaky indeed! It does not open up in Dock or Desktop, yet when I try to trash it I get the message, complete with OS9 icon: Can't move because file is open. In get info the checkbox 'open in classic' is checked and cannot be unchecked. Unlocking in permissions useless. I take it that this is a classic app, but I have not used classic in years so this seems only for classic users. I hope it disappears at the next, hopefully far in the future, reboot!
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Feb 2001
Status:
Offline
|
|
You could do this with a one line find command in the terminal:
find ~/.Trash/ -mtime 180 -ok rm -f {} ';'
finds all files in your trash older than 180 days, and deleted them
Add this to your local crontab:
mkdir ~/bin
cd ~/bin
pico -w mycrontab
Enter into pico the following:
0 1 * * * find ~/.Trash/ -mtime 180 -ok rm -f {} ';' > /dev/null 2>&1
Load the crontab:
crontab mycrontab
That should be all you need to do.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|