Skip to content
Snippets Groups Projects
Commit 3a94bf24 authored by Fredrik Andresen's avatar Fredrik Andresen
Browse files

Script

parent 0b65faaf
No related branches found
No related tags found
No related merge requests found
......@@ -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 {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment