2 Commits 52076397b8 ... ccd79d912a

Autore SHA1 Messaggio Data
  David Witham ccd79d912a Updated Aragorn file 2 anni fa
  David Witham f2ae8bad4f Updated WinSCP location 2 anni fa
2 ha cambiato i file con 11 aggiunte e 11 eliminazioni
  1. 10 10
      backup_aragorn.psm1
  2. 1 1
      backup_to_server.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
 "@
 

+ 1 - 1
backup_to_server.psm1

@@ -19,7 +19,7 @@ function backup_to_server {
     if (!(Test-Path $key_file) ) { write-host "Unable to find a key for connecting to the server"; return }
 
     # Setup to use 7zip and add WinSCP to the path
-    $env:Path += ";C:\Program Files\7-Zip;C:\Program Files (x86)\WinSCP"
+    $env:Path += ";C:\Program Files\7-Zip;C:\Users\betha\AppData\Local\Programs\WinSCP"
     if (! (Test-Path 'C:\Program Files\7-Zip\7z.exe')) {
         Write-Error "Unable to locate 7-zip program file"
         exit 1