A rule triggering on file deletion

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

Moderator: Mr_Noodle

A rule triggering on file deletion Tue Aug 13, 2024 4:17 pm • by Graf_Wetter
Hi,
I need a rule that checks for monitoring reasons, if files are manually removed or deleted by a user.
I have a main folder that should be watched by hazel.
This folder contains several subfolders with changing names containing the single files.
A rule should be triggered as soon as one or many files in the subfolders are moved/deleted from it.
The deletion of the subfolders themselves should not trigger.
Is that possible ?
Thanks,
Jörg
Graf_Wetter
 
Posts: 45
Joined: Thu Aug 25, 2011 7:18 am

Re: A rule triggering on file deletion Wed Aug 14, 2024 8:30 am • by Mr_Noodle
Hazel doesn't match files when they are deleted but you can match a subfolder. If you match on date modified, that should catch any additions/removals from the folder.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: A rule triggering on file deletion Wed Aug 14, 2024 8:52 am • by Graf_Wetter
yes, I know, but I only need to catch removals.
I´m thinking about a workaround with a "secret" folder copy of the watched folder. Then I check for changes on the watched folder as you suggested and trigger a script with each change to compare the number of files in both watched folder and folder copy.
If the number of files in the folder copy is higher than in the watched folder, someone deleted files.
Not very smart, but it could work.
Graf_Wetter
 
Posts: 45
Joined: Thu Aug 25, 2011 7:18 am


Return to Support