Bugfix:portable Programme wurden nicht gesichert

This commit is contained in:
Michael Grote 2021-06-15 09:05:57 +02:00
parent 2756e0a8db
commit dab21e9219

View file

@ -30,13 +30,13 @@ $restic_logfile_name=-join($hostname_ist,"_",$timestamp,".log") # definiere logf
$restic_repository="\\fileserver2.grote.lan\backup\restic" # restic repo $restic_repository="\\fileserver2.grote.lan\backup\restic" # restic repo
$restic_backupdir1="C:\Users\mg" $restic_backupdir1="C:\Users\mg"
$restic_backupdir2="C:\Portable_Programme" $restic_backupdir2="C:\Portable_Programme"
$restic_backupdir2="C:\Users\mg\AppData\Roaming\Apple Computer\MobileSync" $restic_backupdir3="C:\Users\mg\AppData\Roaming\Apple Computer\MobileSync"
$restic_path= Join-Path $scriptpfad bin\restic.exe $restic_path= Join-Path $scriptpfad bin\restic.exe
################################ Logik ####################################### ################################ Logik #######################################
if ($hostname_ist -eq $hostname_soll){ if ($hostname_ist -eq $hostname_soll){
Write-Host -ForegroundColor GREEN "restic backup laeuft..." Write-Host -ForegroundColor GREEN "restic backup laeuft..."
& $restic_path --cleanup-cache --repo $restic_repository --password-file $scriptpfad\config\password.txt backup --exclude-file $scriptpfad\config\exclude.txt $restic_backupdir1 $restic_backupdir2 $restic_backupdir2 2>&1> $restic_logfile_dir\$restic_logfile_name & $restic_path --cleanup-cache --repo $restic_repository --password-file $scriptpfad\config\password.txt backup --exclude-file $scriptpfad\config\exclude.txt $restic_backupdir1 $restic_backupdir2 $restic_backupdir3 2>&1> $restic_logfile_dir\$restic_logfile_name
if (($LastExitCode -eq 0) -or ($LastExitCode -eq 3)){ #3 besagt das bestimmte Dateien nicht geoeffnet werden konnten if (($LastExitCode -eq 0) -or ($LastExitCode -eq 3)){ #3 besagt das bestimmte Dateien nicht geoeffnet werden konnten
Write-Host -ForegroundColor GREEN "restic backup erfolgreich" Write-Host -ForegroundColor GREEN "restic backup erfolgreich"