Scheduler retries due to broken internet connection

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 destination.host.name || goto failed
exit 0

:failed
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.