I’m a new user of FreeFileSync (v14.7) and I am currently running it on a Mac Mini M4 with macOS Tahoe 26.3. While setting up my workflow, I realized I was missing a feature that is essential for my needs: automatically starting a backup as soon as an external drive is connected.
Since this "On-Mount" trigger isn't natively available, I collaborated with Google Gemini AI to build a workaround using macOS native tools. It works perfectly on this specific OS version, but being new to FFS and macOS scripting, I would love to get your expert advice on how to improve or harden this setup.
The Current Solution
The challenge with macOS WatchPaths is that it triggers on any file-system change, which can lead to infinite loops during a backup (especially when FFS starts writing to the target). To solve this, we implemented a persistent lock logic: the script only resets when the drive is physically disconnected.
1. The trigger (~/Library/LaunchAgents/com.user.freefilesync.plist)
This agent monitors /Volumes for any mount/unmount events.
<?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">
<dict>
<key>Label</key>
<string>com.user.freefilesync</string>
<key>ProgramArguments</key>
<array>
<string>/bin/bash</string>
<string>/Users/yourname/script/auto_ffs.sh</string>
</array>
<key>WatchPaths</key>
<array>
<string>/Volumes</string>
</array>
</dict>
</plist>
2. The logic script (auto_ffs.sh)
The script ensures exactly one backup per physical connection.
#!/bin/bash
TARGET_VOLUME="/Volumes/Your_Backup_Drive"
FFS_BATCH="/Path/To/Your/Config.ffs_batch"
LOCKFILE="/tmp/ffs_backup.lock"
# 1. RESET: If drive is NOT connected, remove the lock and exit
if [ ! -d "$TARGET_VOLUME" ]; then
if [ -f "$LOCKFILE" ]; then
rm -f "$LOCKFILE"
fi
exit 0
fi
# 2. ANTI-LOOP: If lock exists, exit (backup already handled for this session)
if [ -f "$LOCKFILE" ]; then
exit 0
fi
# 3. EXECUTION
touch "$LOCKFILE"
osascript -e 'display notification "Sync Started..." with title "FreeFileSync"'
# Launch via 'open' to respect macOS GUI environment
open -a "FreeFileSync" --args "$FFS_BATCH"
# Monitor process: Wait until FFS closes before final notification
sleep 5
while pgrep -x "FreeFileSync" > /dev/null; do
sleep 2
done
osascript -e 'display notification "Backup Completed!" with title "FreeFileSync"'
say "Backup completed"
Seeking advice & feedback
I'm quite happy with how this works on macOS Tahoe, but I have a few concerns I'd like to discuss with the community:
a) Security: to run this, I had to grant Full Disk Access to "/bin/bash". In macOS 26.3, this feels like a very broad permission. Is there a more restricted way to authorize only this specific script?
b) Logic: is "pgrep" the most reliable way to monitor a batch job launched via open -a, or is there a better flag/signal I should use?
c) Stability: for those on recent macOS versions, have you noticed any issues with "WatchPaths" reliability or excessive CPU wake-ups?
d) Native features: Is there a "pro" way to do this within FreeFileSync that I might have overlooked as a beginner?
I look forward to your suggestions and hope this guide helps anyone else looking for an automated "Plug & Play" backup solution on Mac!
Thanks.