]> git.p6c8.net - dsmonrot.git/blobdiff - dsmonrot.ps1
- Removed the old `net use` lines as they are now saved in the Git
[dsmonrot.git] / dsmonrot.ps1
index bb56cdff951fe219eb9a1e1d4e6c37d533f3e23f..b838d7500bf8cf52597d417fbfeeda4567aa4431 100644 (file)
@@ -3,7 +3,7 @@
 #\r
 # Author: Patrick Canterino <patrick@patrick-canterino.de>\r
 # WWW: https://www.patrick-canterino.de/\r
-#      https://github.com/pcanterino/dsmonrot/\r
+#      https://github.com/pcanterino/dsmonrot\r
 # License: 2-Clause BSD License\r
 #\r
 # Drive Snapshot is copyright by Tom Ehlert\r
@@ -95,13 +95,11 @@ if($smbDrive) {
                        $smbCredential = New-Object System.Management.Automation.PSCredential($smbUser, $secSmbPassword)\r
 \r
                        New-PSDrive -Name $smbDrive -PSProvider "FileSystem" -Root $smbPath -Credential $smbCredential -Persist -ErrorAction Stop\r
-                       #net use "$smbDrive`:" $smbPath $smbPassword /user:$smbUser\r
                }\r
                else {\r
                        Write-Host "Without credentials"\r
                \r
                        New-PSDrive -Name $smbDrive -PSProvider "FileSystem" -Root $smbPath -Persist -ErrorAction Stop\r
-                       #net use "$smbDrive`:" $smbPath\r
                }\r
                \r
                $smbConnected = $True\r
@@ -149,7 +147,7 @@ if((Test-Path $backupTarget) -and (Test-Path $backupTargetFull) -and (Test-Path
                        exit\r
                }\r
                \r
-               $dsArgs = @($disksToBackup, "$backupTargetFull\`$disk.sna", "-h$backupTargetFull\`$disk.hsh") + $dsAdditionalArgs\r
+               $dsArgs = @($disksToBackup, "$backupTargetDiff\`$disk.sna", "-h$backupTargetFull\`$disk.hsh") + $dsAdditionalArgs\r
                Write-Host $dsPath ($dsArgs -join " ")\r
                \r
                & $dsPath $dsArgs\r
@@ -214,7 +212,6 @@ if($isDiff -eq $False -and $success -eq $True -and $keepMonths -ge 0) {
 if($smbConnected) {\r
        Write-Host "Disconnecting network drive"\r
        Remove-PSDrive $smbDrive\r
-       #net use "$smbDrive`:" /delete\r
 }\r
 \r
 if($emailOnError -and $errorMessages.Count -gt 0) {\r

patrick-canterino.de