Bladeren bron

Updated Aragorn file

David Witham 2 jaren geleden
bovenliggende
commit
ccd79d912a
1 gewijzigde bestanden met toevoegingen van 10 en 10 verwijderingen
  1. 10 10
      backup_aragorn.psm1

+ 10 - 10
backup_aragorn.psm1

@@ -72,8 +72,9 @@ function backup_aragorn {
     backupDir $backupDisk $myName $HOME          "David"    $homeOptions
 
     # Backup the Data disk
-    backupDir $backupDisk $myName "D:\david\"    "dDavid"   $basicOptions
-    backupDir $backupDisk $myName "D:\public\"   "dPublic"  $basicOptions
+    backupDir $backupDisk $myName "D:\David\"     "dDavid"   $basicOptions
+    backupDir $backupDisk $myName "D:\DavidHome\" "dHome"    $basicOptions
+    backupDir $backupDisk $myName "D:\Public\"    "dPublic"  $basicOptions
 
     # Wrap up and update the log
     $logger.EndLog()
@@ -87,20 +88,20 @@ function check_disk($diskoverride=$false) {
 
     # Test the age of the backup on the disk
     $last_updated = Get-Date (Get-Content (Join-Path $backupDisk.DeviceID "Aragorn\updated.txt"))
-    if ($last_updated.AddDays(20) -lt (Get-Date)) {
+    if ($last_updated.AddDays(20) -gt (Get-Date)) {
         if (!($diskoverride)) {
             Write-Host -ForegroundColor DarkRed "This disk was last used less than 3 weeks ago. Override with -diskoverride."
-            #throw 'Unable to proceed'
-            #Exit 1
+            throw 'Unable to proceed'
+            Exit 1
         }
     }
 
     
     # How much free space is there?
-    if ($backupDisk.FreeSpace / 1gb -lt 20) {
-        Write-Host -ForegroundColor DarkRed "There is less than 20gb free on the disk."
-        #throw 'Unable to proceed'
-        #Exit 1
+    if ($backupDisk.FreeSpace / 1gb -lt 100) {
+        Write-Host -ForegroundColor DarkRed "There is less than 200gb free on the disk."
+        throw 'Unable to proceed'
+        Exit 1
     }
 
 
@@ -194,7 +195,6 @@ Application Data
 MicrosoftEdgeBackups
 Cookies
 .cache
-.vagrant.d
 .vscode
 "@