Trouble with "is not among the 2 most recent" condition

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

Moderator: Mr_Noodle

I use DEVONthink's backup-to-zip file function. I direct all backups to a single folder ~/backups/DEVONthink/. Each backup file uses the naming convention of database name+datetime, e.g. "RMS Things 2021-11-01-10-33-24.dtBase2.zip". Backups for all databases (I have about a dozen) go into this single folder, each with a different file name.

I want to configure Hazel to watch this folder ~/backups/DEVONthink and for each set of backup files for each database, delete all but the last two. I have used a rule setup which doesn't work and I can't spot what wrong:

If "all" of the following conditions are met
- Date Created is not among the 2 most recent
- name contains RMS Things
Do the following to the matched file or folder
- Move to folder Trash (options replace the existing file and throw away if a duplicate checked on)
- Display notification with pattern "Trashed [file]

When the rule is fired on the folder, nothing happens and files keep accumulating.

Surely something obvious, but I'm missing the obvious. Thanks.
rmschne
 
Posts: 8
Joined: Mon Jan 16, 2017 7:29 am

Try going through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Report back with the results.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

oh, why didn't I think of that ... thanks.

I further inspected the conditions, and they are working. Correctly identifies the files to take action.

Inspecting the log further:

2021-11-01 14:54:46.635 hazelworker[62565] Received error while processing file /Users/rmschne/.Trash: Error Domain=NSCocoaErrorDomain Code=257 "The file “Trash” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///Users/rmschne/.Trash, NSFilePath=/Users/rmschne/.Trash, NSUnderlyingError=0x60000213ad60 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}

So ... don't have permissions to .Trash. Hazel has "Full Disk Access" whereas I could not find "hazelworker" to give it that access. Somewhere a missing permission.

Recent upgrade to Monteray 12.0.1

Edit:

Just looked further at log and shows a lot of odd folders with .Trash that trying to do something. Bolded.

2021-11-01 14:54:46.635 hazelworker[62565] Received error while processing file /Users/rmschne/.Trash: Error Domain=NSCocoaErrorDomain Code=257 "The file “Trash” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///Users/rmschne/.Trash, NSFilePath=/Users/rmschne/.Trash, NSUnderlyingError=0x60000213ad60 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
2021-11-01 14:54:46.645 hazelworker[62565] Received error while processing file /System/Volumes/VM/.Trashes/501: Error Domain=NSCocoaErrorDomain Code=257 "The file “Trash” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///System/Volumes/VM/.Trashes/501, NSFilePath=/System/Volumes/VM/.Trashes/501, NSUnderlyingError=0x60000213a0d0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
2021-11-01 14:54:46.648 hazelworker[62565] Received error while processing file /System/Volumes/Preboot/.Trashes/501: Error Domain=NSCocoaErrorDomain Code=257 "The file “Trash” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///System/Volumes/Preboot/.Trashes/501, NSFilePath=/System/Volumes/Preboot/.Trashes/501, NSUnderlyingError=0x60000213df20 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
2021-11-01 14:54:46.651 hazelworker[62565] Received error while processing file /System/Volumes/Update/.Trashes/501: Error Domain=NSCocoaErrorDomain Code=257 "The file “Trash” couldn’t be opened because you don’t have permission to view it." UserInfo={NSURL=file:///System/Volumes/Update/.Trashes/501, NSFilePath=/System/Volumes/Update/.Trashes/501, NSUnderlyingError=0x60000213a4f0 {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"}}
202
rmschne
 
Posts: 8
Joined: Mon Jan 16, 2017 7:29 am

I think I found source of problem, nothing to do with Hazel (no surprise!).

I had for many years a folder ~/bin where i stored my batch programs. This I think conflicts with MacOSX wanting to have a folder ~/Bin which is part of the trash system. I don't know when that started or maybe there all the time.

Hazel moving stuff to "Trash" working ok on my Macbook. I'll sort out folder names, permissions, etc. on the iMac where the Hazel move to "trash" not working. Oh dear.

thanks.
rmschne
 
Posts: 8
Joined: Mon Jan 16, 2017 7:29 am

Weird, I've never heard of ~/Bin being used for trash. I also have ~/bin and haven't seen this.
Mr_Noodle
Site Admin
 
Posts: 11193
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support