I have a GoPro 4 which ends up creating very large high quality videos, when connected through USB the Gopro importer app automatically copies the files to a subfolder named by todays date in /users/apple/Pictures/GoPro . Once the files are copied from the GoPro to the /Pictures/GoPro/DATE_Subfolder they are deleted from the GoPro automatically.

These files fill up my macbook hard drive fast so i have brought a external SSD to house all my video files as well as Final Cut Pro X.

What I would like is a script which auto runs on connection of the external SSD, to move the contents of /Pictures/GoPro to /Volumes/Ext_SSD/GoPro then delete the original files from /Pictures/GoPro

Is this possible? I have had a mess around with Automator and can get files to move then delete when the SSD is already connected, but if files are put in the folder when the SSD is disconnected it will not be moved over when the SSD is finally connected again.


You can do this using a launch Agent or Daemon. If you just want this to work for a certain user you would put the below plist in the users launchAgent folder located at


Otherwise set it system wide by using a launchDaemon and putting the below plist in the folder located at


The below launch plist uses the key "StartOnMount" (any drive being mounted) and watches the file path /Volumes/. Anytime you put in a external drive and it gets mounted to the /Volumes/ folder it will trigger your script or automator file. Just change the path in the below to the location of your script.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <string>Backup To External</string>

More information from MacTech Pay attention to recipe 7

  • Thanks for you assistance, i tried this but to be honest i dont really know what im doing. I am stuck on making a sh script. I managed to find the launchdaemons folder, i created a plist using terminal but stuck now :(
    – PaulHam
    Jan 8 '15 at 17:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .