Newbie: Deleting -contents- of folder regularly

Get help. Get answers. Let others lend you a hand.

Moderator: Mr_Noodle

Hello! I'm new here.

I would like to use Hazel to regularly delete the contents of the following subfolders:
com.apple.iTunes/fsCachedData/ and

com.apple.iTunes/SubscriptionPlayCache/

when these folders get say, more than 100 MB each.

I tried using the Color Label optoin to mark the folders and delete when Size is greater than... which works, but then the folder is gone and the label is gone when the folder is recreated.

Any recs on how to accomplish this with Hazel? This is my first time using the app, found it when trying to solve this huge iTunes playcache problem. I would like to empty that directory out regularly.
saikyo
 
Posts: 4
Joined: Fri Oct 16, 2015 8:05 pm

How about matching them by name?
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Oh. Duh.

Trying this:
within: com.apple.iTunes
if all conditions true:
name is fsCachedData
size is 25 MB

Move to folder: .... but for some reason it does not allow me to select Trash, it's greyed out.

Any advice there? First time 'noodling' with this app!

Also, within the folder SubscriptionPlayCache many .mp4 files are created in a tree of sub folders about 2 or 3 levels deep. Is there away to destroy everything under SubscriptionPlayCache every say, 6 hours?or when it gets beyond a certain size?
saikyo
 
Posts: 4
Joined: Fri Oct 16, 2015 8:05 pm

Is it possible your trash folder is damaged? Does putting things in the trash from Finder still work?

As for removing everything under that folder, is there a reason you want to do that over just removing the whole folder itself?
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

I can drag items from anywhere into the trash icon in the doc with no trouble. Opening the Trash folder from the doc also seems to function normally.

I'm fine removing the entire folder.

Can I do that by making rules...

if all

name is SubscriptionPlayCache
size is greater than 100 MB.

Hrm. Still though I can't do MOVE to Trash because Trash is greyed out... strange... do i need to maybe edit some admin privileges or something? I'm logged in as an admin however.
saikyo
 
Posts: 4
Joined: Fri Oct 16, 2015 8:05 pm

On the commandline, try this:
Code: Select all
ls -ld ~/.Trash

Let me know what it outputs.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Last login: Sat Oct 17 07:58:27 on ttys000
usercomp:~ user1$ ls -ld ~./Trash
ls: ~./Trash: No such file or directory
usercomp:~ harvey$


that sounds bad.
saikyo
 
Posts: 4
Joined: Fri Oct 16, 2015 8:05 pm

Yeah, that means your home trash folder is gone. To re-create it, do this in Terminal:
Code: Select all
mkdir ~/.Trash

Hopefully that should fix things.
Mr_Noodle
Site Admin
 
Posts: 11868
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support