Monitor Duplicati in Windows using Event Logs

If Duplicati is run as an administrative level account, then when executed, this should leave Windows Event log entries that monitoring software can usually pick up:
%ScriptPath%\Duplicati_Pre.cmd:

REM Create Running Status
EVENTCREATE /T INFORMATION /L APPLICATION /SO Duplicati /ID 205 /D "%DUPLICATI__BACKUP_NAME% - Starting Duplicati Backup Job"

%ScriptPath%\Duplicati_Post.cmd:

REM Create Result Status from Parsed Results

SET DSTATUS=%DUPLICATI__PARSED_RESULT%
If %DSTATUS%==Fatal GOTO DSError
If %DSTATUS%==Error GOTO DSError
If %DSTATUS%==Unknown GOTO DSWarning
If %DSTATUS%==Warning GOTO DSWarning
If %DSTATUS%==Success GOTO DSSuccess
GOTO END

:DSError
EVENTCREATE /T ERROR /L APPLICATION /SO Duplicati /ID 202 /D "%DUPLICATI__BACKUP_NAME% - Error running Duplicati Backup Job"
GOTO END

:DSWarning
EVENTCREATE /T WARNING /L APPLICATION /SO Duplicati /ID 201 /D "%DUPLICATI__BACKUP_NAME% - Warning running Duplicati Backup Job"
GOTO END

:DSSuccess
EVENTCREATE /T SUCCESS /L APPLICATION /SO Duplicati /ID 200 /D "%DUPLICATI__BACKUP_NAME% - Success in running Duplicati Backup Job"
GOTO END

:END
SET DSTATUS=

In the Settings page. on the “Add advanced option”
I selected “run-script-after” and “run-script-before” Both with the full drive and path "C:\PathToScripts\Duplicati_Post.cmd" & "C:\PathToScripts\Duplicati_Pre.cmd" respectively

Thanks,
]<

p.s. Thanks to JonMikeIV for helping me format this to be easier to read.

2 Likes