history
- Fixed the path for the differential backups
#\r
# Author: Patrick Canterino <patrick@patrick-canterino.de>\r
# WWW: https://www.patrick-canterino.de/\r
#\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
# License: 2-Clause BSD License\r
#\r
# Drive Snapshot is copyright by Tom Ehlert\r
$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
$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
}\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
}\r
\r
$smbConnected = $True\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
Write-Host $dsPath ($dsArgs -join " ")\r
\r
& $dsPath $dsArgs\r
if($smbConnected) {\r
Write-Host "Disconnecting network drive"\r
Remove-PSDrive $smbDrive\r
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
}\r
\r
if($emailOnError -and $errorMessages.Count -gt 0) {\r