Wanting to only keep 10 most recent files in a Dropbox folde

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

Moderator: Mr_Noodle

So, I'm a brand new Hazel user and so far I'm loving what it can do. But there's something I'm trying to make happen, and it's not working and I'm sure there's an easy fix, but for some reason, I'm not finding it.

I have a folder in Dropbox and I'm trying to keep it's size down, so I only want the most recent 10 files in it. The files get added at random times, so having that based on a certain time period won't work for me. Instead, I really just want Hazel to make sure there are only ten files in that folder and if there aren't, to delete the least recent files.

Based on other forum posts I read, I created a rule that works perfectly when I tell it to just label the files green where the "Date Added IS NOT AMONG THE 10 most recent files". It looks at the folder (which currently has 25 files) and labels every file green except for the 10 most recent ones. But when I use that same rule to move the files to the Trash, it winds up deleting every single file in the folder. I tried changing to Date Modified and get the same results: works fine when I want to label, but moving to another folder, moves everything.

I probably am not really understanding how the "most recent files" is parsed because removing files from the folder seems to change things.

I'm sure I'm being a bone head, but could someone point out where I'm going wrong?

Image

Also -- another bonehead question -- when reading the Troubleshooting post, I was happy to see there was a Preview Mode. But when I click on the gear/cog menu under the Rules list, I can't seem to find it.

Image

Any help would be greatly appreciated! Thanks!
alexwoolfson
 
Posts: 9
Joined: Thu Aug 01, 2013 3:15 pm

I am unsure why this deletes everything in the folder. I just ran a test on my machine, and everything worked as expected. Are there other files in this folder?

As for the second question, click on the "eye" icon, and you'll find the preview.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

a_freyer wrote:I am unsure why this deletes everything in the folder. I just ran a test on my machine, and everything worked as expected. Are there other files in this folder?

As for the second question, click on the "eye" icon, and you'll find the preview.


Thank you for your response. I'm not sure if this answers your question, but there are 25 files in the folder I'm applying the rule to, each one older than the other, all from the last several months. Of course, once files start to get moved, there is then less than 25 and files keep getting removed one-by-one until all are gone.

I wish I knew why this wasn't working for me. Other Hazel rules I've created seem to work great.

Thank you also for the "eye" icon tip. It was greyed out for me, but comparing to other active rules, that seems to be because I current have this rule unchecked. (Because it's doing this weird thing.) So, if I want to preview something safely, I'll need to pause all the rules for that folder?

Thank you very much for your help!
alexwoolfson
 
Posts: 9
Joined: Thu Aug 01, 2013 3:15 pm

What I mean by 'other files' is: Are there any other file types in this folder? For example, there may only be 25 PDFs, but there are other files/folders there too.
a_freyer
 
Posts: 631
Joined: Tue Sep 30, 2008 9:21 am
Location: Colorado

a_freyer wrote:What I mean by 'other files' is: Are there any other file types in this folder? For example, there may only be 25 PDFs, but there are other files/folders there too.


Ah, I'm sorry. There are only Adobe TIFF files. I did just add the TO BE DELETED folder into the same folder (so I wouldn't have to keep retrieving files from the Trash), but I was having the issue before I added that folder.
alexwoolfson
 
Posts: 9
Joined: Thu Aug 01, 2013 3:15 pm

Because this is such a weird issue, I've since tried a restart just in case, but I'm getting the same results.

I paused the rule and tested it with the Preview Mode which, much like when I used labels, did exactly what I'd want the rule to. It moved every file except for the 10 most recent. But once I activated the rule, it didn't do what the Preview Mode showed; instead it moved every file (all 33) except for one, and that file was not the file with the most recent Last Modified date.

Somehow the act of Hazel moving the files is changing how Hazel is interpreting this rule on the files that are left.

Maybe it's a Dropbox thing, but I'm baffled... I wish I could make this work...
alexwoolfson
 
Posts: 9
Joined: Thu Aug 01, 2013 3:15 pm

Turn on debug mode (there's a sticky article near the top to show how to do this). After that, click the "View Log" button in the "Info" section.

Now with the logs up, click on the "Insert Marker" button which will insert some text into the logs. In Hazel, check the preview and make sure again that it shows what you want (all but 10 files matching that rule). Now, do "Run rules now". Wait a bit. When it's done, grab the logs from the marker to the end and email those in (click "Contact Support" in Hazel). I'll take a look and see what's going wrong.
Mr_Noodle
Site Admin
 
Posts: 11865
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Mr_Noodle wrote:Turn on debug mode (there's a sticky article near the top to show how to do this). After that, click the "View Log" button in the "Info" section.

Now with the logs up, click on the "Insert Marker" button which will insert some text into the logs. In Hazel, check the preview and make sure again that it shows what you want (all but 10 files matching that rule). Now, do "Run rules now". Wait a bit. When it's done, grab the logs from the marker to the end and email those in (click "Contact Support" in Hazel). I'll take a look and see what's going wrong.


Done!

I activated Debug Mode, placed my marker, checked the preview (all seemed to work, leaving the 10 most recent files) and then ran the rule which moved every file except for one to the new folder. I've just emailed the log result to you.

I hope we're able to figure this out. Please let me know if you need anything else. Thanks!
alexwoolfson
 
Posts: 9
Joined: Thu Aug 01, 2013 3:15 pm


Return to Support