I can describe my setup that works very well for a few months now. I’m backing up to SFTP share with key-based authentication.
My duplicacy repository is my home folder /Users/myusername and hence all configuration and other data duplicacy keeps is in ~/.duplicacy/
All other duplicacy related stuff (including SSH keys, launchd daemon, scripts, etc) I also keep there.
My preferences file looks like so:
I have put launchd plist in the same folder and just made a symlink to it under /Library/LaunchDaemons/
The plist looks like so:
<?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">
You can call duplicacy directly by the launchd, but for experimentation I’ve put all relevant code into .sh file under the same .duplciacy storage and call it from there.
It looks like this for me:
caffeinate -s nice duplicacy backup
# After two weeks keep a version every day
# After 90 days keep a version every week
# After one year keep a version every month
caffeinate -s nice duplicacy prune -keep 31:360 -keep 7:90 -keep 1:14
caffeinate -s nice duplicacy prune
Note, you can safely remove “caffeinate” and “nice” from there - but I left it there for occasions when I run that .sh directly.
Another note - duplicacy is so ridiculously fast that caffeinate is not really needed
Third note - stdout and stderr as you can see from the plist are redirected to /tmp/duplicacy.*