(Another) script for macOS

Hi all, sharing a personal script I use on my Macbook to automate duplicacy.

This is a zsh shell script automated with launchd; and checks battery, wifi, and time since last backup before running. It stores the last revision timestamp locally and does an offline check before running, to minimize footprint of the background process.

Tested working with macOS 15 (which broke some scripts calling SSID). I’ve also just added Healthchecks integration in the last version.

There are already plenty of wonderful and feature-rich tools out there, but this simple script works for my use case, and I hope the code may help anyone who may be stuck on their own script (like I was on many occasions!). Any part of this script may be easily adapted for duplicacy’s native pre/post command script function.

1 Like

Copy this plist into ~/Library/LaunchAgents/ .

I would symlink it there.

This won’t work as described unless you grant duplicacy executable full disk access (or at least, access to specific folders, like Documents and Pictures). You might want to mention that.

This also will only backup current user. I guess it’s ok to do it per-user, but maybe an option for “all users” backup may be great.

Nice touch about battery threshold!