Seeking Advice on Automating Archive Cleanup + Rename Rules

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

Moderator: Mr_Noodle

Hi everyone,

I’ve been using Hazel for a while now and it has been awesome for keeping my folders tidy, but I’m looking to take my setup a bit further and could use some community insight.

What I’m trying to do is:

1. Automatically clean up old downloaded archive files (e.g., .zip, .rar, .7z) after a set period (say 30 days), but

2. Before removal, extract them to a dated folder (e.g., YYYY-MM-DD Archive Extractions) and

3. Rename the extracted contents based on metadata (like a prefix using the archive name + a date stamp).

I’ve got the basic cleanup working, and I’ve also got extraction to a folder working separately, but when I try to combine the extraction, rename, and cleanup all into a single rule with multiple actions, Hazel doesn’t always behave as expected.

Specifically:

* Some archives extract correctly but the renamed files don’t get renamed consistently.

* If the archive name has special characters, the date rename action fails or gets skipped.

* Once extraction is done, I’d love the original to be moved to a “Processed Archives” folder before the 30-day auto-delete triggers.

Does anyone have tips or example rules/scripts (AppleScript / Hazel advanced rules / shell) that do something similar? I’m happy to share my current rule setup and debug logs if that helps — just let me know what format is most useful.

Thanks in advance for any suggestions!
kennethkeith
 
Posts: 1
Joined: Tue Jan 27, 2026 11:30 pm

Several issues here.

First, understand that the Unarchive action already throws away the original archive after extraction. Any actions in the same rule operate on the extracted contents. If there are multiple files, they are put into a folder with the same name as the archive.

If you want to save the archive file, you will need to copy it first. Note that any actions in the same rule after a Copy action will act on the copy, not the original.

As a result of the above, you need separate rules. By default, Hazel only executes the first rule to match a file so you will need to use the Continue action to allow a file to match multiple rules.

I don't know what kind of renaming you are doing and what kind of contents are in the files. You will need to provide a lot more detail on that.
Mr_Noodle
Site Admin
 
Posts: 12132
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support