Page 1 of 1

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

PostPosted: Mon Nov 01, 2021 6:52 am
by rmschne
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.

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

PostPosted: Mon Nov 01, 2021 10:18 am
by Mr_Noodle
Try going through the troubleshooting guide here: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Report back with the results.

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

PostPosted: Mon Nov 01, 2021 10:59 am
by rmschne
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

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

PostPosted: Mon Nov 01, 2021 11:40 am
by rmschne
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.

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

PostPosted: Tue Nov 02, 2021 10:33 am
by Mr_Noodle
Weird, I've never heard of ~/Bin being used for trash. I also have ~/bin and haven't seen this.