Keeping only last copy

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

Moderator: Mr_Noodle

Keeping only last copy 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?
jmfontana
 
Posts: 12
Joined: Mon Oct 25, 2021 10:58 am

Re: Keeping only last copy 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.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City


Return to Support