Automatically backing up folders from my mac to an external hard drive

I would like to back up certain folders from my macbook pro (Monterey OS) to an external hard drive. I want this to be an automatic process everytime I connect the hard drive. I don't want to have to do this manually every time.

How can I set it up for certain folders to be added to the external hard drive automatically everytime I connect the hard drive?

MacBook Pro 15″, macOS 12.7

Posted on Oct 5, 2023 6:17 PM

Reply
Question marked as Best reply

Posted on Oct 5, 2023 6:25 PM

Back up your files with Time Machine on Mac - Apple Support


You cannot explicitly state which folders you want to back up, but you can do the inverse which is to exclude everything that you do not want backed up.

7 replies

Oct 5, 2023 8:12 PM in response to John Galt

Here is a better and simpler method using Automator. You don't need an AppleScript.


The key to triggering the automatic copy action is to use red_menace's technique:


"Open Automator, choose the Folder Action template, and select Other... in the workflow popup menu to get a dialog to choose the folder to attach it to. You won't see the /Volumes folder in the dialog, since it is invisible and all, but you just jumped through that hoop, so it will be under Recent Places in the toolbar's path popup menu."


Do that, and the rest flows from there.


Basic instructions are as follows:


  1. In the the Finder's Go menu > Go to Folder... type /Volumes then Go. Leave that window open.
  2. Decide upon the folder that will contain all the items you wish to automatically copy to the external hard disk whenever you connect it. For this example I named it "copy these".
  3. In Automator, choose "Folder Action". At the top, choose Folder Action receives files and folders added to and choose Other... from the dropdown menu. Drag the hard disk icon from /Volumes into its dialog box.
  4. Then, using Library > Files and Folders, add Get Specified Finder Items, followed by Copy Finder Items. In its dropdown menu adjacent to To: choose the destination on the external drive. You will probably want to check the box for Replacing existing files since they are intended to be backups.
  5. Save the Automator Folder Action.


Then, whenever you connect the external hard disk drive, all the items in "copy these" will be copied to it.

Automatically backing up folders from my mac to an external hard drive

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.