Run exe on Successful backup

You can use the options --run-script-after to execute a script after a backup is completed (successful or unsuccessful).
I think a script like this could do the trick:

@echo off
set "ProgramSuccess=C:\Prog\Prog1.exe"
set "ProgramFail=C:\Prog\Prog2.exe"
set "Tempfile=%Temp%\_Duplicati_Result.tmp"
if exist "%Tempfile%" del "%Tempfile%"
type "%DUPLICATI__RESULTFILE%" >> "%Tempfile%"
for /f "tokens=1,2 usebackq delims=: " %%a in ("%Tempfile%") do (
  if /i "%%a"=="ParsedResult" (
    if /i "%%b"=="Success" (
      start "%ProgramSuccess%"
    ) else (
      start "%ProgramFail%"
    )
  )
)

WARNING: I didn’t test this script, use at your own risk!
You can find some example scripts here:

1 Like