This rule will
do nothing at all except show you which files Hazel is matching:- Code: Select all
if (all) of the following conditions are met for (the file or folder being processed):
kind is folder
date created is not in the last 20 days
Do the following to the matched file or folder:
ignore file
Once you write this rule, click the eye icon at the bottom of the folder list. This will preview the rule matches for you. Once in the preview menu, you see which rules are matching which files or folders. In your case, if a folder does not match and you expect it to, click the (i) icon so that you can see what Hazel sees.
This is a great way to test what files match
before you actually try to move them to the trash.
In your case, the rule will eventually look like this:
- Code: Select all
if (all) of the following conditions are met for (the file or folder being processed):
kind is folder
date created is not in the last 20 days
Do the following to the matched file or folder:
move to folder trash
.
Generally speaking, it is not a good idea to immediately remove a file or folder. For example, if you make a mistake. However, if you are 100% sure that you want to permanently delete every file that Hazel matches without any chance of file recovery, you can do one of a few things.
First, under the 'Trash' tab of Hazel, set the 'Keep Trash Under' to 1MB. This should clear your trash very quickly.
Second, under the same tab, you can say 'delete files sitting in the Trash for more than 1 hour' to give yourself a buffer.
Lastly, (not recommended
at all) you can add a shell script to your actions section like this:
- Code: Select all
rm -r "$1"