Page 1 of 1

Keeping only last copy

PostPosted: Thu Jul 27, 2023 10:56 am
by jmfontana
I have a rule that copies certain configuration files to a network folder whenever they change. This is basically a backup strategy that allows me to access the contents of these files from different computers. What Hazel does makes sense and it is to add a number to the file name if a file with that name already exists. Yet, in this case, this is a bit of an annoyance since these files change very often and I wind up accumulating too many files. What would be the way of only keeping the last two or three copies and eliminating the oldest copy every time a new copy is added?

Re: Keeping only last copy

PostPosted: Fri Jul 28, 2023 10:10 am
by Mr_Noodle
Do you need to keep any old copies? You can choose the replace option to always replace the existing one.

If you match all but the X most recent, you can do something like "Date last modified is not among the X most recent". Note that this won't remove the number in the filename.