PowerShell script to run Duplicati GUI jobs

Discovered an issue, if only one drive is connected the backup will only run if it matches the day of the week, this was not the intended behavior.

Fix, open the script in PSH ISE or in a text editor (with line numbers enabled) and add a line, see below for details.

In the function Get-Drives (line 302, if you copied from above).
Find the line that says
write-host "Today's backup drive was NOT found," -f Yellow (line 323)
at the end of that line hit return and add this to the new line (line 324)
$FoundDrive = $FoundDrives[0]

After the edit it should look like the following,

line 323: write-host "Today's backup drive was NOT found," -f Yellow
line 324: $FoundDrive = $FoundDrives[0]
line 325: write-host "The $FoundDrive drive was the only one found." -f Yellow

Once saved, backups will run even if the day/driveNames do not match, as originally intended.

Side note, lines 337 - 350 (after the addition of the above line, otherwise they would be lines 336 - 349) can also be deleted as they are already commented <# #> out and provide no purpose as is.

Extra side note, I’ve begun working on version 1.3 that will add some new few features and hopefully clean up the code a bit. Planned features include delayed/deferred job scheduling and saving a copy of the local DB post run (for what it’s worth) to the destination, tossing a few other ideas around but we’ll see what makes it in.

1 Like