Run-scrip-after successful backup, with cmd window


I have read a few threads on here regarding ‘run-script-after’ – but I’m having some trouble getting this to work the way I want. I am using Duplicati GUI.

After a successful backup, I want Duplicati to run a .cmd script to sync the destination with rclone. This works great:


C:\rclone\rclone.exe sync D:\Backup_Test_Destination OneDrive:Test --progress

But, how to get that to pop up in a cmd.exe window so I can view the progress of the sync as it’s running? If I do the below, it pops up the cmd window and runs the rclone sync as soon as the Duplicati backup is started. So it syncs before the backup is even done.


start cmd.exe /k C:\rclone\rclone.exe sync D:\Backup_Test_Destination OneDrive:Test --progress

Sorry, I have trouble believing this can be possible. How could the after backup script get the backup result before it’s finished ?

Make sure you’re actually using that, and not something similar.

You can do this without all the start stuff. Do you really prefer to watch it?

I use a run-script-after to check my backup, using rclone the other way like

set STEP=rclone sync to local
C:\bin\rclone sync "%REMOTE%" "%LOCAL%\sync" --backup-dir="%LOCAL%\backup" --verbose=1 2> "%LOCAL%\rclone.log"
if %ERRORLEVEL% NEQ 0 goto error

Exit Code is probably what I relied on. I don’t think I researched their forum
because it wasn’t that important to me, but your situation might be different.

One drawback of extensive work in a normal run-script-after is it delays the
ability of Duplicati to run other things (including another backup) for awhile,
however one can signal any error back to Duplicati for final late processing:

echo %DATE% %TIME% %STEP% >> "%LOCAL%\error.log"
exit /b 4

The 4 will alert Duplicati which can then alert you via any of many methods.


On the other hand, if the intent is to write fast to a drive, then upload slowly,
consider any risks or confusions of next backup starting during prior upload.