From 3a94bf24d3b24aff38e696eecc8b1a465de7f793 Mon Sep 17 00:00:00 2001 From: Fredrik Andresen <freand@stud.ntnu.no> Date: Sun, 14 Feb 2021 22:56:56 +0100 Subject: [PATCH] Script --- properBackup.ps1 | 2 -- 1 file changed, 2 deletions(-) diff --git a/properBackup.ps1 b/properBackup.ps1 index ea7756c..988d8a4 100644 --- a/properBackup.ps1 +++ b/properBackup.ps1 @@ -19,7 +19,6 @@ function doBackup { New-Item -Path $incBackupFolderLocation -Name "inBackup" -ItemType "directory" $differences | Where-Object {$_.SideIndicator -eq "<="} | ForEach-Object { #Venstrepil betyr at filen bare er i backup. Fjerner først filer. Mapper kopieres over i incremental. $relativePathFromSourceFolder = $_.Fullname.split($newestBackup.FullName)[1]; - Write-Output "wwww"$_.Fullname.split($newestBackup.FullName)[1] $fullPathAtIncBackupLocation = Join-Path -Path $incBackupFolderLocation -ChildPath "inBackup" $relativePathFromSourceFolder Copy-Item $_.FullName -Destination $fullPathAtIncBackupLocation -Force Write-Output $_.FullName @@ -96,7 +95,6 @@ function doRestore { $newestBackupzip = Get-ChildItem $backupLocation | Where-Object {$_.Name -match "Backup_"} | Where-Object {$_.Extension -match "zip"} | Select-Object -First 1 #Finner nyeste backup zip. Expand-Archive $newestBackupzip (Join-Path -Path $newestBackupzip.Directory -ChildPath $newestBackupzip.BaseName) $newestBackup = Get-ChildItem $backupLocation | Where-Object {$_.Name -match "Backup_"} | Where-Object {$_.Name -notmatch "-Increment"} | Select-Object -First 1 - Write-Output ($incrementalsToApply -is [int]) if ($incrementalsToApply -is [int]) { $incrementalBackups = Get-ChildItem $backupLocation | Where-Object {$_.Name -match "-Increment"} | Select-Object -First $incrementalsToApply $incrementalBackups | ForEach-Object { -- GitLab