How to permanently delete all files in a folder?

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

Moderator: Mr_Noodle

Hi,

I would like to know how I can delete all files in a folder using Hazel. Here is what I need to achieve:

- Permanently delete all files in the Documents, Downloads, and Desktop folder if the file is older than 2 hours (Not just going to trash but permanently deleting files)

OR

- Permanently delete all files in the abovementioned folders upon logoff using Hazel. Not interested in messing around with Automator/Apple scripts etc, if possible.

Thanks in advance
kelvinl
 
Posts: 2
Joined: Wed May 04, 2022 3:20 am

There's no built-in action to permanently delete files. You can have Hazel purge files from the trash but they need to go to the trash first.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Thanks for the reply.

Ignore the "permanently delete" part, how can I delete all files in a specific folder and move the files to the trash based on the age of the files? Like doing an "hourly cleanup" of a folder?
kelvinl
 
Posts: 2
Joined: Wed May 04, 2022 3:20 am

You can do something like "Date added is not in the last X hours/day/etc, Move to trash" should do it. If you need to go into subfolders, check the manual on how to get Hazel to do that.
Mr_Noodle
Site Admin
 
Posts: 11867
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support