Duplicacy should not proceed if pre-* scripts fail


Duplicacy shall not proceed with whatever operation if pre-whatever script exited with non-zero code.

Use case examples (potentially implementable in GUI based on user feedback/possible telemetry usage data):

  • Cancel operation if remaining battery life is under threshold
  • Cancel operation if connected to certain [wireless] network
  • Cancel operation is moon is full and date is Friday 13
  • etc.

In the current state the error is reported, e.g. Failed to run script: exit status 1 but backup still proceeds. What’s the point of checking exit status and then ignoring it… Perhaps I should have posted this in the “bugs” section instead.

mymac:~ me$ cat .duplicacy/scripts/pre-backup
exit 1
mymac:~ me$ duplicacy -version |grep -A 1 -i "version" | grep -v -i "version"
mymac:~ me$ duplicacy backup
Running script /Users/me/.duplicacy/scripts/pre-backup
Failed to run script: exit status 1
Storage set to sftp://me@my.server.com:22//Volumes/duplicacy
Last backup at revision 283 found
Indexing /Users/me
Loaded 46 include/exclude pattern(s)

or a metered network!

1 Like

Another request for this feature in Controlling backup behaviour when errors occur in pre/post scripts


This feature is #planned for after the holidays!



Any update on the pre-backup script exit status stopping backup?

Interested in this as well. Any new status update, please?

Did this get implemented? Trialling duplicacy web edition and want to disable backup on wrong wifi network/ on battery. I can probably work out a script for this, but no point if duplicacy doesn’t exit like good backup software.

I believe this is not implemented yet.

Oh ok. I’m still doing my initial backup so still testing how well incrementals are happening but have high hopes. I was using ARQ (I am on a macbook) but it has a real problem with maintaining backups and takes a long time to complete.
With ARQ I wanted to ensure backups didn’t kick off when I was out in a coffee shop only connected over a VPN to my office for example! (both wrong wifi and on battery in that case!)

1 Like

Hi there - just wondering if there’d been any progress on this feature? Having a pre-abort script feature would open up lots of functionality like avoiding backing up when on Wifi, or when on battery power. Would make it massively more useful for me as someone who’s in and out of the home office all the time :slight_smile:

1 Like

This feature was included in release 2.3.0: CLI 2.3.0 released


This topic was automatically closed after 40 days. New replies are no longer allowed.