Feature request: Better scheduling with Duplicati

Here’s an example cmd script that uses the error codes mentioned in @ts678’s post above. I know it isn’t as pretty as if Duplicati’s scheduler had this built in, but it should work.

This checks the current hour and only runs the backup if it’s between 8 and 18. Could be made more robust to handle weekdays/weekends differently.

@echo off

for /f "tokens=1 delims=/:" %%a in ('time /t') do (set _hour=%%a)

if %_hour% lss 8 goto nobackup
if %_hour% gtr 18 goto nobackup

exit 0

:nobackup
exit 1

This may need to be adjusted depending on your locale settings.

1 Like