Duplicati vs. CrashPlan Home

As a workaround, you can use the command line option --run-script-before-required to launch a script that performs one or more tests. If one of the tests succeeds, the script exits with errorlevel 0, otherwise it exits with errorlevel 1.

Duplicati will abort the backup job if the script specified with --run-script-before-required returns anything else than 0.

A script could look something like this:

@echo off
setlocal enabledelayedexpansion

set ErrLev=1

rem Check if connected to SSID "MyHomeNetwork"
for /f "tokens=1,2 delims=:" %%a in ('netsh wlan show interfaces ^| find " SSID"') do (set SSID=%%b)
set SSID=!SSID:~1!
if "!SSID!" equ "MyHomeNetwork" (set ErrLev=0)

rem check if IP 172.16.1.254 can be reached
ping -n 1 -w 500 172.16.1.54 > nul 2> nul
if errorlevel 1 goto :IP_172_16_1_254_Not_Found
set ErrLev=0
:IP_172_16_1_254_Not_Found

rem check if wired interface "Ethernet" is connected AND \\SERVER1\Share\Testfile.txt can be found
for /f "tokens=1,2 delims=:" %%a in ('netsh interface show interface Ethernet ^| find "Connect state:"') do (set State=%%b)
if "!State!" equ "!State:Disconnected=!" (
   if exist "\\SERVER1\Share\Testfile.txt" (
      set ErrLev=0
   )
)

exit !ErrLev!

DISCLAIMER: Script not tested, use at your own risk!
(Originally posted at GitHub, reposted here, because this post fits better here).

2 Likes