Copy and rename with date / tiem stamp.?

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

Moderator: Mr_Noodle

Copy and rename with date / tiem stamp.? Mon Jul 03, 2023 10:04 am • by tekguru
At the moment I have a rule which runs on my 'numbers' folder which triggers on:
- Extension is numbers
- Date Last Modified is after Date Last Matched
It then copies the file to three different destinations:
'\Dropbox\Numbers backup'
'\OneDrive\Numbers backup'
'\MyNAS\Numbers backup'

Ideally I'd wish for the copied file to be renamed as '<filename>YYYY-MM-DD HH:MM:SS<extension>. That is, I'd get a dated / timed backup of each file. Unless I'm missing something it seems that this can't be accomplished in one rule?

To try and get around this I've created a second rule which runs on the destination folder. This is as follows and is triggered on:
- Extension is numbers
- Date Last Modified is after Date Last Matched
It then:
Rename with pattern <name><date created><extension>
This seems like it should do what I want, but a lot of the spreadsheets are not getting renamed. So is the 'Date Last Modified is after Date Last Matched' criteria the wrong one to use? If so what should I choose instead?
tekguru
 
Posts: 20
Joined: Tue Dec 07, 2021 3:09 pm

It's the right one if you want to match files that have been modified since the last time it was checked. Go through the troubleshooting guide here to try and isolate the issue: https://www.noodlesoft.com/kb/hazel-tro ... ing-guide/

Report back with your findings from that.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Copy and rename with date / tiem stamp.? Tue Jul 04, 2023 9:32 am • by tekguru
I’ll check it out once I get home. I basically want to rename the file after it has first been copied into that directory.
tekguru
 
Posts: 20
Joined: Tue Dec 07, 2021 3:09 pm

Re: Copy and rename with date / tiem stamp.? Tue Jul 04, 2023 11:16 am • by tekguru
I just checked out the conditions of

- Extension is numbers
- Date Last Modified is after Date Last Matched

for the rename rule. It does work on newly copied files:

e.g. "Daron - 2023 Weight" is renamed to "Daron - 2023 Weight 2023-07-03 15_01_32"

However any existent files which have already been renamed get renamed again.

e.g. "Apps using iCloud 2023-05-26 13_34_17" gets renamed to 'Apps using iCloud 2023-05-26 13_34_17 2023-05-26 13_34_17"

If there is a way to stop that double renaming that'd be a workable solution. I guess an additional condition needs adding but I've no idea as to what.
I hope that makes sense........
tekguru
 
Posts: 20
Joined: Tue Dec 07, 2021 3:09 pm

Re: Copy and rename with date / tiem stamp.? Wed Jul 05, 2023 7:52 am • by tekguru
I've had to give up on the time stamp rule. I managed to limit it by adding criteria so that the rule would not run if 2022, 2023, or 2024 were included in the file name.
However some existent spreadsheets do include the year as part of the filename so that isn't a viable solution for a lot of the files.
tekguru
 
Posts: 20
Joined: Tue Dec 07, 2021 3:09 pm

There are several ways to prevent the file being renamed. You can add conditions to match on the name and if it's already in the format you want, do not match. Or you can add a tag to the file which you then check in the conditions.
Mr_Noodle
Site Admin
 
Posts: 11255
Joined: Sun Sep 03, 2006 1:30 am
Location: New York City

Re: Copy and rename with date / tiem stamp.? Wed Jul 05, 2023 9:39 am • by tekguru
Fantastic - Using tags seems less complicated and indeed it works beautifully. I've now got it running under test and will see how it goes!
Many thanks.
tekguru
 
Posts: 20
Joined: Tue Dec 07, 2021 3:09 pm


Return to Support