Page 1 of 1

Newbie: Deleting -contents- of folder regularly

PostPosted: Fri Oct 16, 2015 8:08 pm
by saikyo
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.

Re: Newbie: Deleting -contents- of folder regularly

PostPosted: Mon Oct 19, 2015 11:34 am
by Mr_Noodle
How about matching them by name?

Re: Newbie: Deleting -contents- of folder regularly

PostPosted: Wed Oct 21, 2015 8:44 am
by saikyo
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?

Re: Newbie: Deleting -contents- of folder regularly

PostPosted: Wed Oct 21, 2015 1:56 pm
by Mr_Noodle
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?

Re: Newbie: Deleting -contents- of folder regularly

PostPosted: Thu Oct 22, 2015 6:07 am
by saikyo
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.

Re: Newbie: Deleting -contents- of folder regularly

PostPosted: Thu Oct 22, 2015 1:19 pm
by Mr_Noodle
On the commandline, try this:
Code: Select all
ls -ld ~/.Trash

Let me know what it outputs.

Re: Newbie: Deleting -contents- of folder regularly

PostPosted: Fri Oct 23, 2015 5:03 am
by saikyo
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.

Re: Newbie: Deleting -contents- of folder regularly

PostPosted: Fri Oct 23, 2015 12:15 pm
by Mr_Noodle
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.