Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

diogenesEPE

macrumors newbie
Original poster
Hello and thanks for your help.

Perhaps the first question is whether it is possible to have a folder from a partition in the Internal disk automatically copy to an external disk, AFTER setup. When it was set up, it worked. After unplugging the external and plugging it back in a few days later, hoping Automator would copy or update files on the external dis. Is this possible. Here's my setup:

Screenshot 2026-03-23 at 22.09.19.png
 
My understanding: Folder Actions are run when (and only when) a file is added to the folder. It does not remember actions which have failed and redo them later.

You would do better with a 3rd party file synchronisation tool. For example, ChronoSync can run a synchronisation job when volume is mounted. Not free, but lifetime (your lifetime) licence with all upgrades. There are alternatives - e.g. FreeFileSync (donation-ware).
 
After unplugging the external and plugging it back in a few days later, hoping Automator would copy or update files on the external dis. Is this possible.
You can trick Folder Actions to do what you want by adding a file to the source folder after connecting the external drive.
 
My understanding: Folder Actions are run when (and only when) a file is added to the folder. It does not remember actions which have failed and redo them later.

You would do better with a 3rd party file synchronisation tool. For example, ChronoSync can run a synchronisation job when volume is mounted. Not free, but lifetime (your lifetime) licence with all upgrades. There are alternatives - e.g. FreeFileSync (donation-ware).
Thanks a lot. I was hoping to get this done, 'local' and not use an external application, certainly not a paid tool. I think I can conclude that what I want to accomplish is not possible. That was part of the question, which makes the second part, how, unnecessary to tackle.
 
You can trick Folder Actions to do what you want by adding a file to the source folder after connecting the external drive.
I tried this, and thanks. It copies the 'new' added file when the external is attached, but all other files that were created before the external driver was attached are not recursively synced. This is rather unfortunate. I have thought of an rysync approach but can't seem to get that going either. Automator would be great with this task, if only they had designed it to deliver in this way.
 
You can create a simple app with Script Editor or Automator to run rsync
Example:
AppleScript:
do shell script "rsync -r --size-only ~/Documents/Porto/ /Volumes/ExternalDrive/Porto1"

or a version that opens Terminal so you can check the progress
AppleScript:
set theCom to "rsync -r --progress --size-only ~/Documents/Porto/ /Volumes/ExternalDrive/Porto1"
tell application "Terminal"
    activate
    do script theCom
end tell

Try with a small folder first.
 
You can create a simple app with Script Editor or Automator to run rsync
Example:
AppleScript:
do shell script "rsync -r --size-only ~/Documents/Porto/ /Volumes/ExternalDrive/Porto1"

or a version that opens Terminal so you can check the progress
AppleScript:
set theCom to "rsync -r --progress --size-only ~/Documents/Porto/ /Volumes/ExternalDrive/Porto1"
tell application "Terminal"
    activate
    do script theCom
end tell

Try with a small folder first.
Thanks a lot.

I have prepared a line that works well in Terminal. I have tested it in either direction and does what it should, including deleting files from the destination.

rsync -avh --delete /Volumes/dataS/porto2 /Volumes/Dawn.ajw.bk/porto2/

i want this automated.

But can't seem to figure out how to:
automate that so that when I plug in the external disk, it automatically runs that line.
the machine has not particular time it is in use, so I can't do a cron job, for example.
That's where I'm stuck.

The options you mentioned are AppleScript and Automator but can't seem to figure either.

I will not shy from asking for a bullet-point 'how-to' and then I can already thank you. And from that will learn how to do similar in the future. As well, you can share your idea as to which you think is better, however you define better, between AppleScript and Automator. Thanks a lot!
 
You can create a simple app with Script Editor or Automator to run rsync
Example:
AppleScript:
do shell script "rsync -r --size-only ~/Documents/Porto/ /Volumes/ExternalDrive/Porto1"

or a version that opens Terminal so you can check the progress
AppleScript:
set theCom to "rsync -r --progress --size-only ~/Documents/Porto/ /Volumes/ExternalDrive/Porto1"
tell application "Terminal"
    activate
    do script theCom
end tell

Try with a small folder first.
I tested your scrip, which also works, in terminal and AppleScript. However, the option of having new windows of Terminal opening, I would like to suppress.
 
I was thinking that you could just click the app in the Dock after connecting the external drive 🙂

While it can be accomplished using a launch agent, it’s probably easier to use an app like Stecker https://stecker.himbeles.de
https://apps.apple.com/app/stecker/id6447288587
“Trigger macOS Shortcuts by physical device attachment or detachment.
Thanks. I will 'downscale' my laziness, as surely not another app.
Question, however, anyway to suppress Terminal coming up each time the script is run?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.