{"id":6955,"date":"2019-11-11T11:09:17","date_gmt":"2019-11-11T16:09:17","guid":{"rendered":"https:\/\/jdhitsolutions.com\/blog\/?p=6955"},"modified":"2019-11-11T11:09:23","modified_gmt":"2019-11-11T16:09:23","slug":"creating-a-powershell-backup-system-part-3","status":"publish","type":"post","link":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/","title":{"rendered":"Creating a PowerShell Backup System &#8211; Part 3"},"content":{"rendered":"<p>Let's continue exploring my PowerShell based backup system. If you are just jumping in, be sure to read <a title=\"read the first article in the series\" href=\"https:\/\/jdhitsolutions.com\/blog\/?p=6905\" target=\"_blank\" rel=\"noopener noreferrer\">part 1<\/a> and <a title=\"Part 2\" href=\"https:\/\/jdhitsolutions.com\/blog\/?p=6910\" target=\"_blank\" rel=\"noopener noreferrer\">part 2<\/a> first. At the end of the previous article I have set up a scheduled job that is logging changed files in key folders to CSV files. The next order of business is to take the data in these files and create my incremental backup. I'm using WinRar as my archiving tool, but you can use whatever command-line application you choose.<\/p>\n<h2>The CSV Files<\/h2>\n<p>My scheduled PowerShell job that is running constantly is creating CSV files with new and changed files.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image-6.png\"><img loading=\"lazy\" decoding=\"async\" title=\"backup CSV files\" style=\"display: inline; background-image: none;\" alt=\"backup CSV files\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-6.png\" width=\"1028\" height=\"483\" border=\"0\"><\/a><\/p>\n<p>The file contents include an entry every time the FileSystemWatcher detected an event.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image-7.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Backup CSV contents\" style=\"display: inline; background-image: none;\" alt=\"Backup CSV contents\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-7.png\" width=\"1028\" height=\"270\" border=\"0\"><\/a><\/p>\n<p>As you can see, there are often multiple entries for the same file. That's OK. I'll handle that with the backup script.<\/p>\n<h2>Backing Up<\/h2>\n<p>To create the incremental backups, I need to import each CSV file, filter out the temp files I don't want to backup, and select unique files. I'm also skipping 0 byte files.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$files = Import-Csv -path $path | Where-Object { ($_.name -notmatch \"~|\\.tmp\") -AND ($_.size -gt 0) -AND ($_.IsFolder -eq 'False') -AND (Test-Path $_.path) } |\n    Select-Object -Property path, size, directory, isfolder, ID | Group-Object -Property Path\n<\/pre>\n<p>$Path is the path to one of the CSV files. You'll also notice that I\"m testing if a file still exists. I may create a file, which would get logged, and delete it later in the day. Obviously it doesn't make sense to attempt to backup a non-existent file. I group the files on their full path name. Here's a peek at what that looks like.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image-8.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Grouped backup files\" style=\"display: inline; background-image: none;\" alt=\"Grouped backup files\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-8.png\" width=\"1028\" height=\"273\" border=\"0\"><\/a><\/p>\n<p>What I need to backup are the files listed as the Name property. For each Name, I'll create a temporary folder and underneath that a subfolder that contains the path of the file. I then copy each file to this temporary location.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">foreach ($file in $files) {\n    $parentFolder = $file.group[0].directory\n    $relPath = Join-Path -Path \"D:\\backtemp\\$Name\" -childpath $parentFolder.Substring(3)\n    if (-Not (Test-Path -path $relpath)) {\n        Write-Host \"Creating $relpath\" -ForegroundColor cyan\n        $new = New-Item -path $relpath -ItemType directory -force\n        # Start-Sleep -Milliseconds 100\n\n        #copy hidden attributes\n        $attrib = (Get-Item $parentfolder -force).Attributes\n        if ($attrib -match \"hidden\") {\n            Write-Host \"Copying attributes from $parentfolder to $($new.FullName)\" -ForegroundColor yellow\n            Write-Host $attrib -ForegroundColor yellow\n            (Get-Item $new.FullName -force).Attributes = $attrib\n        }\n    }\n    Write-Host \"Copying $($file.name) to $relpath\" -ForegroundColor green\n    $f = Copy-Item -Path $file.Name -Destination $relpath -Force -PassThru\n    #copy attributes\n    $f.Attributes = (Get-Item $file.name -force).Attributes\n} #foreach file\n<\/pre>\n<p>Because I'm trying to recreate the folder structure in the archive I also copy attributes from the parent folder of each file. This allows me to save the .git folders as hidden in my backup. I can then archive each folder and remove the temporary items and the CSV file so I can repeat the process with a fresh start.<\/p>\n<p>Here's the complete incremental backup script.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">Import-Module C:\\scripts\\PSRAR\\Dev-PSRar.psm1 -force\n\n$paths = Get-ChildItem -Path D:\\Backup\\*.csv | Select-Object -ExpandProperty Fullname\n\nforeach ($path in $paths) {\n\n    $name = (Split-Path -Path $Path -Leaf).split(\"-\")[0]\n    $files = Import-Csv -path $path | Where-Object { ($_.name -notmatch \"~|\\.tmp\") -AND ($_.size -gt 0) -AND ($_.IsFolder -eq 'False') -AND (Test-Path $_.path) } |\n    Select-Object -Property path, size, directory, isfolder, ID | Group-Object -Property Path\n\n    foreach ($file in $files) {\n        $parentFolder = $file.group[0].directory\n        $relPath = Join-Path -Path \"D:\\backtemp\\$Name\" -childpath $parentFolder.Substring(3)\n        if (-Not (Test-Path -path $relpath)) {\n            Write-Host \"Creating $relpath\" -ForegroundColor cyan\n            $new = New-Item -path $relpath -ItemType directory -force\n            # Start-Sleep -Milliseconds 100\n\n            #copy hidden attributes\n            $attrib = (Get-Item $parentfolder -force).Attributes\n            if ($attrib -match \"hidden\") {\n                Write-Host \"Copying attributes from $parentfolder to $($new.FullName)\" -ForegroundColor yellow\n                Write-Host $attrib -ForegroundColor yellow\n                (Get-Item $new.FullName -force).Attributes = $attrib\n            }\n        }\n        Write-Host \"Copying $($file.name) to $relpath\" -ForegroundColor green\n        $f = Copy-Item -Path $file.Name -Destination $relpath -Force -PassThru\n        #copy attributes\n        $f.Attributes = (Get-Item $file.name -force).Attributes\n    } #foreach file\n\n    #create a RAR archive or substitute your archiving code\n    $archive = Join-Path D:\\BackTemp -ChildPath \"$(Get-Date -Format yyyyMMdd)_$name-INCREMENTAL.rar\"\n    Add-RARContent -Object $relPath -Archive $archive -CompressionLevel 5 -Comment \"Incremental backup $(Get-Date)\"\n    Move-Item -Path $archive -Destination \\\\ds416\\backup -Force\n\n    Remove-Item $relPath -Force -Recurse\n    Remove-Item $path\n\n} #foreach path\n<\/pre>\n<h2>Creating the Scheduled Job<\/h2>\n<p>The last part of the process is to setup another PowerShell scheduled job to process the CSV files and backup the files. I run my weekly full backup on Friday nights at 10:00PM. I still need to share that code with you in a future article. This means I can skip running an incremental backup on Friday night. I use this code to create the PowerShell scheduled job.<\/p>\n<pre class=\"lang:ps mark:0 decode:true\">$filepath = \"C:\\scripts\\IncrementalBackup.ps1\"\n\nif (Test-Path $filepath) {\n    $trigger = New-JobTrigger -At 10:00PM -DaysOfWeek Saturday,Sunday,Monday,Tuesday,Wednesday,Thursday -Weekly\n    $jobOpt = New-ScheduledJobOption -RunElevated -RequireNetwork -WakeToRun\n\n    Register-ScheduledJob -FilePath $filepath -Name \"DailyIncremental\" -Trigger $trigger -ScheduledJobOption $jobOpt -MaxResultCount 7 -Credential jeff\n}\nelse {\n    Write-Warning \"Can't find $filepath\"\n}\n<\/pre>\n<p>Because I am copying files to my NAS device, I need to include a credential.<\/p>\n<p>Here are some of my recent results.<\/p>\n<p><a href=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image-9.png\"><img loading=\"lazy\" decoding=\"async\" title=\"Incremental archives\" style=\"display: inline; background-image: none;\" alt=\"Incremental archives\" src=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-9.png\" width=\"1028\" height=\"323\" border=\"0\"><\/a><\/p>\n<h2>Next Time<\/h2>\n<p>In the next article in this series I'll go over the full backup code I'm using, plus a few management control scripts that help me keep on top of the process.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Let&#8217;s continue exploring my PowerShell based backup system. If you are just jumping in, be sure to read part 1 and part 2 first. At the end of the previous article I have set up a scheduled job that is logging changed files in key folders to CSV files. The next order of business is&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"Posted: Creating a #PowerShell Backup System - Part 3","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[201,534,540],"class_list":["post-6955","post","type-post","status-publish","format-standard","hentry","category-powershell","tag-backup","tag-powershell","tag-scripting"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Creating a PowerShell Backup System - Part 3 &#8226; The Lonely Administrator<\/title>\n<meta name=\"description\" content=\"A continuation in my series demonstrating aPowerShell backup solution. In this article, I show how I use the CSV data of changed files via a scheduled job.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Creating a PowerShell Backup System - Part 3 &#8226; The Lonely Administrator\" \/>\n<meta property=\"og:description\" content=\"A continuation in my series demonstrating aPowerShell backup solution. In this article, I show how I use the CSV data of changed files via a scheduled job.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/\" \/>\n<meta property=\"og:site_name\" content=\"The Lonely Administrator\" \/>\n<meta property=\"article:published_time\" content=\"2019-11-11T16:09:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-11-11T16:09:23+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-6.png\" \/>\n<meta name=\"author\" content=\"Jeffery Hicks\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:site\" content=\"@JeffHicks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeffery Hicks\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/\"},\"author\":{\"name\":\"Jeffery Hicks\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"headline\":\"Creating a PowerShell Backup System &#8211; Part 3\",\"datePublished\":\"2019-11-11T16:09:17+00:00\",\"dateModified\":\"2019-11-11T16:09:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/\"},\"wordCount\":492,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/image_thumb-6.png\",\"keywords\":[\"Backup\",\"PowerShell\",\"Scripting\"],\"articleSection\":[\"PowerShell\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/\",\"name\":\"Creating a PowerShell Backup System - Part 3 &#8226; The Lonely Administrator\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/image_thumb-6.png\",\"datePublished\":\"2019-11-11T16:09:17+00:00\",\"dateModified\":\"2019-11-11T16:09:23+00:00\",\"description\":\"A continuation in my series demonstrating aPowerShell backup solution. In this article, I show how I use the CSV data of changed files via a scheduled job.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/#primaryimage\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/image_thumb-6.png\",\"contentUrl\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/wp-content\\\/uploads\\\/2019\\\/11\\\/image_thumb-6.png\",\"width\":1028,\"height\":483},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/powershell\\\/6955\\\/creating-a-powershell-backup-system-part-3\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"PowerShell\",\"item\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/category\\\/powershell\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Creating a PowerShell Backup System &#8211; Part 3\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/\",\"name\":\"The Lonely Administrator\",\"description\":\"Practical Advice for the Automating IT Pro\",\"publisher\":{\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/jdhitsolutions.com\\\/blog\\\/#\\\/schema\\\/person\\\/d0258030b41f07fd745f4078bdf5b6c9\",\"name\":\"Jeffery Hicks\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\",\"caption\":\"Jeffery Hicks\"},\"logo\":{\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Creating a PowerShell Backup System - Part 3 &#8226; The Lonely Administrator","description":"A continuation in my series demonstrating aPowerShell backup solution. In this article, I show how I use the CSV data of changed files via a scheduled job.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/","og_locale":"en_US","og_type":"article","og_title":"Creating a PowerShell Backup System - Part 3 &#8226; The Lonely Administrator","og_description":"A continuation in my series demonstrating aPowerShell backup solution. In this article, I show how I use the CSV data of changed files via a scheduled job.","og_url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/","og_site_name":"The Lonely Administrator","article_published_time":"2019-11-11T16:09:17+00:00","article_modified_time":"2019-11-11T16:09:23+00:00","og_image":[{"url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-6.png","type":"","width":"","height":""}],"author":"Jeffery Hicks","twitter_card":"summary_large_image","twitter_creator":"@JeffHicks","twitter_site":"@JeffHicks","twitter_misc":{"Written by":"Jeffery Hicks","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/#article","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/"},"author":{"name":"Jeffery Hicks","@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"headline":"Creating a PowerShell Backup System &#8211; Part 3","datePublished":"2019-11-11T16:09:17+00:00","dateModified":"2019-11-11T16:09:23+00:00","mainEntityOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/"},"wordCount":492,"commentCount":3,"publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-6.png","keywords":["Backup","PowerShell","Scripting"],"articleSection":["PowerShell"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/","url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/","name":"Creating a PowerShell Backup System - Part 3 &#8226; The Lonely Administrator","isPartOf":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/#primaryimage"},"image":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/#primaryimage"},"thumbnailUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-6.png","datePublished":"2019-11-11T16:09:17+00:00","dateModified":"2019-11-11T16:09:23+00:00","description":"A continuation in my series demonstrating aPowerShell backup solution. In this article, I show how I use the CSV data of changed files via a scheduled job.","breadcrumb":{"@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/#primaryimage","url":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-6.png","contentUrl":"https:\/\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-6.png","width":1028,"height":483},{"@type":"BreadcrumbList","@id":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6955\/creating-a-powershell-backup-system-part-3\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"PowerShell","item":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},{"@type":"ListItem","position":2,"name":"Creating a PowerShell Backup System &#8211; Part 3"}]},{"@type":"WebSite","@id":"https:\/\/jdhitsolutions.com\/blog\/#website","url":"https:\/\/jdhitsolutions.com\/blog\/","name":"The Lonely Administrator","description":"Practical Advice for the Automating IT Pro","publisher":{"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/jdhitsolutions.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/jdhitsolutions.com\/blog\/#\/schema\/person\/d0258030b41f07fd745f4078bdf5b6c9","name":"Jeffery Hicks","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg","caption":"Jeffery Hicks"},"logo":{"@id":"https:\/\/secure.gravatar.com\/avatar\/832ae5d438fdcfc1420d720cd1991307927de8a0b12f2342e81c30f773e21098?s=96&d=wavatar&r=pg"}}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":6910,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6910\/creating-a-powershell-backup-system-part-2\/","url_meta":{"origin":6955,"position":0},"title":"Creating a PowerShell Backup System Part 2","author":"Jeffery Hicks","date":"November 8, 2019","format":false,"excerpt":"Yesterday I began a series of articles documenting my PowerShell based backup system. The core of my system is using the System.IO.FileSystemWatcher as a means to track daily file changes so I know what to backup. However there are some challenges. I need to watch several folders, I need to\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"Checking pending files","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-5.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-5.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-5.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-5.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6996,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6996\/powershell-controller-scripts\/","url_meta":{"origin":6955,"position":1},"title":"PowerShell Controller Scripts","author":"Jeffery Hicks","date":"November 26, 2019","format":false,"excerpt":"When it comes to PowerShell scripting we tend to focus a lot on functions and modules. We place an emphasis on building re-usable tools. The idea is that we can then use these tools at a PowerShell prompt to achieve a given task. More than likely, these tasks are repetitive.\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-21.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-21.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-21.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-21.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6962,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6962\/creating-a-powershell-backup-system-part-4\/","url_meta":{"origin":6955,"position":2},"title":"Creating a PowerShell Backup System &#8211; Part 4","author":"Jeffery Hicks","date":"November 12, 2019","format":false,"excerpt":"We're almost to the end of my PowerShell backup system. Last time I showed you how I handle my daily incremental backups. Today I figured I should circle back and go over how I handle weekly full backups. Remember, I am only concerned about backing up a handful of critical\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-11.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-11.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-11.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-11.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":6905,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/6905\/creating-a-powershell-backup-system\/","url_meta":{"origin":6955,"position":3},"title":"Creating a PowerShell Backup System","author":"Jeffery Hicks","date":"November 7, 2019","format":false,"excerpt":"If you follow me on Twitter, you know that I have a monthly tweet reminder about running and testing backups. I have to say that the concept of a backup is different today than it was when I started in IT. Now we have cheap disk storage and cloud services.\u2026","rel":"","context":"In &quot;PowerShell&quot;","block_context":{"text":"PowerShell","link":"https:\/\/jdhitsolutions.com\/blog\/category\/powershell\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-4.png?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-4.png?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-4.png?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2019\/11\/image_thumb-4.png?resize=700%2C400&ssl=1 2x"},"classes":[]},{"id":4112,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/4112\/scary-powershell\/","url_meta":{"origin":6955,"position":4},"title":"Scary PowerShell","author":"Jeffery Hicks","date":"October 31, 2014","format":false,"excerpt":"In honor of today's festivities, at least in the United States, I thought we'd look at some scary PowerShell. I have seen a lot of scary things in blog posts, tweets and forum discussions. Often these scary things are from people just getting started with PowerShell who simply haven't learned\u2026","rel":"","context":"In &quot;Best Practices&quot;","block_context":{"text":"Best Practices","link":"https:\/\/jdhitsolutions.com\/blog\/category\/best-practices\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2014\/10\/103114_1654_ScaryPowerS1.jpg?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":3042,"url":"https:\/\/jdhitsolutions.com\/blog\/powershell\/3042\/friday-fun-a-powershell-tickler\/","url_meta":{"origin":6955,"position":5},"title":"Friday Fun: A PowerShell Tickler","author":"Jeffery Hicks","date":"May 17, 2013","format":false,"excerpt":"I spend a lot of my day in the PowerShell console. As you might imagine, I often have a lot going on and sometimes it is a challenge to keep on top of everything. So I thought I could use PowerShell to help out. I created a PowerShell tickler system.\u2026","rel":"","context":"In &quot;Friday Fun&quot;","block_context":{"text":"Friday Fun","link":"https:\/\/jdhitsolutions.com\/blog\/category\/friday-fun\/"},"img":{"alt_text":"elmo","src":"https:\/\/i0.wp.com\/jdhitsolutions.com\/blog\/wp-content\/uploads\/2013\/05\/elmo-221x300.jpg?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=6955"}],"version-history":[{"count":0,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/6955\/revisions"}],"wp:attachment":[{"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=6955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=6955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/jdhitsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=6955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}