From: Patrick Canterino Date: Wed, 17 Jan 2018 17:49:33 +0000 (+0100) Subject: - Removed the old `net use` lines as they are now saved in the Git X-Git-Url: https://git.p6c8.net/dsmonrot.git/commitdiff_plain/bca3ccac96405fb70f0bf68ae4bf19233e295971?hp=f2c9203140f0b87a690880410cd612bf1f034c62 - Removed the old `net use` lines as they are now saved in the Git history - Fixed the path for the differential backups --- diff --git a/dsmonrot.ps1 b/dsmonrot.ps1 index bb56cdf..b838d75 100644 --- a/dsmonrot.ps1 +++ b/dsmonrot.ps1 @@ -3,7 +3,7 @@ # # Author: Patrick Canterino # WWW: https://www.patrick-canterino.de/ -# https://github.com/pcanterino/dsmonrot/ +# https://github.com/pcanterino/dsmonrot # License: 2-Clause BSD License # # Drive Snapshot is copyright by Tom Ehlert @@ -95,13 +95,11 @@ if($smbDrive) { $smbCredential = New-Object System.Management.Automation.PSCredential($smbUser, $secSmbPassword) New-PSDrive -Name $smbDrive -PSProvider "FileSystem" -Root $smbPath -Credential $smbCredential -Persist -ErrorAction Stop - #net use "$smbDrive`:" $smbPath $smbPassword /user:$smbUser } else { Write-Host "Without credentials" New-PSDrive -Name $smbDrive -PSProvider "FileSystem" -Root $smbPath -Persist -ErrorAction Stop - #net use "$smbDrive`:" $smbPath } $smbConnected = $True @@ -149,7 +147,7 @@ if((Test-Path $backupTarget) -and (Test-Path $backupTargetFull) -and (Test-Path exit } - $dsArgs = @($disksToBackup, "$backupTargetFull\`$disk.sna", "-h$backupTargetFull\`$disk.hsh") + $dsAdditionalArgs + $dsArgs = @($disksToBackup, "$backupTargetDiff\`$disk.sna", "-h$backupTargetFull\`$disk.hsh") + $dsAdditionalArgs Write-Host $dsPath ($dsArgs -join " ") & $dsPath $dsArgs @@ -214,7 +212,6 @@ if($isDiff -eq $False -and $success -eq $True -and $keepMonths -ge 0) { if($smbConnected) { Write-Host "Disconnecting network drive" Remove-PSDrive $smbDrive - #net use "$smbDrive`:" /delete } if($emailOnError -and $errorMessages.Count -gt 0) {