Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > macOS > Auto-empty-trash after (say) six months

Auto-empty-trash after (say) six months
Thread Tools
philm
Mac Elite
Join Date: May 2001
Location: Manchester, UK
Status: Offline
Reply With Quote
Dec 19, 2005, 08:46 PM
 
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?
     
rjenkinson
Professional Poster
Join Date: Sep 2000
Status: Offline
Reply With Quote
Dec 19, 2005, 09:45 PM
 
smart folder + an applescript that moves everything to the trash?

-r.
     
black bear theory
Grizzled Veteran
Join Date: Aug 2005
Location: fairbanks AK
Status: Offline
Reply With Quote
Dec 24, 2005, 03:58 AM
 
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.
     
RevEvs
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status: Offline
Reply With Quote
Dec 24, 2005, 09:00 AM
 
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.
     
cybergoober
Mac Elite
Join Date: Jun 2003
Location: Newport News, VA USA
Status: Offline
Reply With Quote
Dec 24, 2005, 09:15 AM
 
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.
     
philm  (op)
Mac Elite
Join Date: May 2001
Location: Manchester, UK
Status: Offline
Reply With Quote
Dec 24, 2005, 10:43 AM
 
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.
     
philm  (op)
Mac Elite
Join Date: May 2001
Location: Manchester, UK
Status: Offline
Reply With Quote
Dec 24, 2005, 10:48 AM
 
Actually, it looks like Freaky Trash Manager could be the way to go, here.
     
RevEvs
Mac Elite
Join Date: Feb 2001
Location: Sitting in front of computer
Status: Offline
Reply With Quote
Dec 24, 2005, 11:18 AM
 
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.
     
Judge_Fire
Mac Elite
Join Date: Jan 2001
Location: Helsinki, Finland
Status: Offline
Reply With Quote
Dec 26, 2005, 07:04 AM
 
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
     
jmiddel
Grizzled Veteran
Join Date: Dec 2001
Location: Land of Enchantment
Status: Offline
Reply With Quote
Dec 28, 2005, 01:52 AM
 
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!
     
ScotHamedia
Fresh-Faced Recruit
Join Date: Feb 2001
Status: Offline
Reply With Quote
Dec 30, 2005, 10:14 PM
 
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 Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 12:20 PM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,