Scheduler retries due to broken internet connection

A couple of my PCs are in a building that frequently drops the internet connection. If this happens during a run, it usually can pick it up and finish. But if the outage happens just before the scheduler wants to start the job, then you get a connection error and you need to wait 24 hours before it will be run automatically again.
I’d like to see an advanced option that allows you to retry the scheduled event in an hour (or other interval) a maximum of x times.
I’d read that this could be accomplished with the run-before/run-after script options and that’s what I will use if no one else thinks this is decent add to the ‘would-like-to-see’ list.
If other members have already accomplished the scripts to do this sort of thing, I’d love to have them available to our community. I’m a big believer in not re-inventing the wheel…

Hmm, I can think of one way to do this, but I’m not sure if it’s too complex for your tastes.

The first trick is to figure out a reliable way to tell if the remote side is unavailable. Perhaps a ping check would suffice? If the ping failed, you would wait some amount of time (say 5 minutes), trigger the backup job to again, and finally exit the script with a special error code that tells Duplicati to “do nothing and don’t flag the job with an error.” Here’s a post where I’ve talked about the special codes before.

How can you trigger the job to run again? One way is with an extra tool called duplicati-client.

So assuming you are on Windows, here’s a sample script that may work for you:

ping -n 2 || goto failed
exit 0

timeout.exe /t 300 /nobreak

duplicati_client.exe login
duplicati_client.exe run backup_id_number
duplicati_client.exe logout

exit 1

Because this script may wait 5 minutes, you’ll need to also adjust the --run-script-timeout value. It defaults to only 1 minute so you’d want to set it to something longer than your wait time plus the time it takes to do your connection test, plus some extra time for good measure. Setting it to 10 minutes would be fine.

Hopefully this helps out a bit.

Thank you Rod

I’m slammed at the moment with other issues, but I will definitely play around with this.