Saving Simultaneously to Duplicate Files

Joined
May 18, 2008
Messages
3,612
Reaction score
95
Points
48
Location
Amberley, Canterbury, New Zealand
Your Mac's Specs
MacMini 14.3, 8.1 & 4.1, OS 13.5, 10.14, & 10.11 & 10.6; Macbook Pro 8.2, OS 10.12.
Macbook Pro, OS 10.13.6 and TextEdit

A much-used flash drive died without warning. RIP. On it were all sorts, but of relevance to this inquiry were 3 or 4 TextEdit files that were duplicates of files on the MBk's desktop. The files on the flash drive were however more up-to-date, thus I have lost some important information.

My question: is there a method to have MacOS save to duplicate files at the same time as an active/open file is updated/saved? Something like a command line that states "save to all files of this xxxxx name".
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Time Machine is an option to save everything on an hourly basis. However, I don't know of any other functionality that will make backups at a faster rate to a variety of locations to ensure a safe backup. The one option I would suggest is that you might want to use a cloud service for your files like iCloud Drive, Box, Dropbox and so on. Depending on storage needs, you could get away with the basic plans offered by many services.
 

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,596
Reaction score
1,072
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Ventura, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
Guys, just throwing an idea out there. I don't have time to test this at the moment and won't jave time before late Tursday/early Friday at the earliest.

I wonder if a folder action would work. In short the process might go something like this:
1. Create a folder somewhere convenient such as on the Desktop. Give it a name like "Work In Progress" or anything else memorable for that matter. This becomes the watch folder that causes the folder action to run.
2. Attach an Automator workflow to the folder that runs when things are added to that folder. I've seen workflows that save when you drop a file into the folder but I am not sure the action would run if you simply save files to the watch folder.

Building on the Dropbpx idea, is this what you had in mind Ashwin?
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
An Automator script/trigger would definitely work if you are going to use local storage for your backup purposes. But if a cloud service is available, it would be just easier to create the folder/files directly on those shared folder and have their sync client do the work for you. Those sync clients essentially do what you are suggesting which is to watch a set of folders for changes and sync them on an ongoing basis.

The only thing against the Cloud method would be if you are playing with many large files, then cost might become an issue.
 
Joined
Jan 1, 2009
Messages
15,452
Reaction score
3,808
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)
The challenge with all of the possible solutions is the slight delay between the original save and any automator/sync action. What the OP apparently wants is simultaneous saving to two files, which is not possible, AFAIK, except into a RAID array. If the delay is acceptable, then the easiest is to use something like Dropbox, or OneDrive, or even iCloud drive to sync the files. I suppose an automator file, as Sly suggested, could be created, but the advantage of the sync approach is that the copy is now off-site, with additional safety of not being even in the same building.

As I said, a RAID array running RAID1 will save two copies, one on each drive. If the array fails, the working drive will have the files. At least that's how it's supposed to work.
 
Joined
Oct 16, 2010
Messages
17,494
Reaction score
1,541
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2011 27" iMac, 1TB(partitioned) SSD, 20GB, OS X 10.11.6 El Capitan
My question: is there a method to have MacOS save to duplicate files at the same time as an active/open file is updated/saved? Something like a command line that states "save to all files of this xxxxx name".


Why not create one folder on your Mac that's handy, and then create a alias in two or several other drives that would each contain a copy of the created and saved files?





- Patrick
======
 
Joined
Jan 1, 2009
Messages
15,452
Reaction score
3,808
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)
Patrick, how would the files get moved to those external drives? An alias on an external would only be a pointer to the internal drive copy. Lose the internal and the alias is useless.
 
Joined
May 21, 2012
Messages
10,702
Reaction score
1,158
Points
113
Location
Rhode Island
Your Mac's Specs
M1 Mac Studio, 11" iPad Pro 3rdGen, iPhone 13 ProMax, Watch S7, 2018 15" MBP, AirPods Pro
Patrick, how would the files get moved to those external drives? An alias on an external would only be a pointer to the internal drive copy. Lose the internal and the alias is useless.
Would an alias, of the USB drive (or a folder on it), on the desktop make the copy to the USB drive happen?
 
Joined
Jul 30, 2009
Messages
7,295
Reaction score
301
Points
83
Location
Wisconsin
Your Mac's Specs
Mac Mini (Late 2014) 2.6GHz Intel Core i5 Memory: 8GB 1600MHz DDR3
The easiest solution is to develop good habits. I save all my often-used files on flash drive. If I edit one, my routine never varies: Save it, Close it, Copy it to the flash drive.
 
Joined
Jan 1, 2009
Messages
15,452
Reaction score
3,808
Points
113
Location
Winchester, VA
Your Mac's Specs
MBP 16" 2023 (M3 Pro), iPhone 15 Pro, plus ATVs, AWatch, MacMinis (multiple)
Would an alias, of the USB drive (or a folder on it), on the desktop make the copy to the USB drive happen?
The challenge is that an alias is just a pointer to a file, not a copy of it. So if the file changes, as long as it's in the same place, the pointer will still point to it. But if that target disappears there is nothing in the alias about the file except where it is, not anything about what was IN that file. So no matter where the alias is, the data will never be there.
 

Raz0rEdge

Well-known member
Staff member
Moderator
Joined
Jul 17, 2009
Messages
15,745
Reaction score
2,071
Points
113
Location
MA
Your Mac's Specs
2022 Mac Studio M1 Max, 2023 M2 MBA
Alias is a red herring and isn't what you want. Either the Automator script or using cloud storage are the only really viable options.
 
Joined
Oct 16, 2010
Messages
17,494
Reaction score
1,541
Points
113
Location
Brentwood Bay, BC, Canada
Your Mac's Specs
2011 27" iMac, 1TB(partitioned) SSD, 20GB, OS X 10.11.6 El Capitan
Here's a old 2007 suggestion that should still work, albeit using a few more recent methods to create the same process:
Is there a way for one Save action to save a file to two separate places?
Saving can be twice as nice
https://www.macworld.com/article/1058960/savetwice.html

A few other hits and suggestions here:
https://www.google.com/search?clien...+separate+locations+on+save&ie=UTF-8&oe=UTF-8

Actually, I like the comments of using good saving habits and I'm sure the SimpleKeys.app I've just recently started using could be used to create a single keyboard key combination when creating an Automator type script that it can use.
Check it out here: https://www.pidog.com/SimpleKeys/

PS: it's quite a slick little app and especially useful for entering often used text with a single fkey or keyboard key combinations. Sort of like the Keyboard pref pane Shortcuts on steroids. :Smirk:





- Patrick
======
 
Joined
May 21, 2012
Messages
10,702
Reaction score
1,158
Points
113
Location
Rhode Island
Your Mac's Specs
M1 Mac Studio, 11" iPad Pro 3rdGen, iPhone 13 ProMax, Watch S7, 2018 15" MBP, AirPods Pro

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top