Delete backup files based on creation date and files count

I have an app that creates a backup file every time I use the app automatically. The backup folder has 1 level deep subfolders:
`/appBackup/subFolder1`
`/appBackup/subFolder2` etc.
I'm trying to use Hazel to keep the backups inside `subFolder*` to 10 max, and delete the rest (keeping the most recent ones of course).
I got a couple rules on `appBackup/`
1) If Kind is Folder → Run rules on folder content
2) if Date created in not in the last 7 days → move to trash
My problem: if I don't use the app for a few days, Hazel will keep on deleting files based on dates, so I need to first check if the currently evaluated folder has more than 10 files before I delete based on date.
I've tried all sorts of combinations with `Sub-file/folder Count` in both rule 1) and 2) but I can't get a match.
I did try to find a solution in the docs, but I can never find what I'm looking for in there… I must have the wrong mental model about how Hazel work. It's always a struggle to get any rule to behave how I want.
I'd really appreciate any help!
Thanks,
`/appBackup/subFolder1`
`/appBackup/subFolder2` etc.
I'm trying to use Hazel to keep the backups inside `subFolder*` to 10 max, and delete the rest (keeping the most recent ones of course).
I got a couple rules on `appBackup/`
1) If Kind is Folder → Run rules on folder content
2) if Date created in not in the last 7 days → move to trash
My problem: if I don't use the app for a few days, Hazel will keep on deleting files based on dates, so I need to first check if the currently evaluated folder has more than 10 files before I delete based on date.
I've tried all sorts of combinations with `Sub-file/folder Count` in both rule 1) and 2) but I can't get a match.
I did try to find a solution in the docs, but I can never find what I'm looking for in there… I must have the wrong mental model about how Hazel work. It's always a struggle to get any rule to behave how I want.
I'd really appreciate any help!
Thanks,