Procházet zdrojové kódy

Added function for the SPU Dir

David Witham před 4 roky
rodič
revize
9c35635128
2 změnil soubory, kde provedl 22 přidání a 0 odebrání
  1. 21 0
      backup_to_server.psm1
  2. 1 0
      exclude_from_sync.list

+ 21 - 0
backup_to_server.psm1

@@ -4,6 +4,7 @@ function backup_to_server {
 
     param(
         [switch]$skipappdir, 
+        [switch]$skipspudir,
         [switch]$noupload, 
         [switch]$skipoutlook)
 
@@ -46,6 +47,26 @@ function backup_to_server {
             } -ArgumentList @($exclude, $backup_file)
     }
 
+    # Create a compressed version of the OneDrive - SPU Dir
+    if (!($skipspudir)) {
+
+        # Create the main backup file
+        $backup_file = "$backup_dir\spudir.7z"
+
+        # Make sure we start in the home folder
+        Set-Location $HOME
+
+        # Remove the previous file (start clean each time)
+        if (Test-Path $backup_file) { Remove-Item $backup_file }
+
+        # Load the exclude list
+        $exclude = parse_appdata_exclude
+
+        # Generate the compressed backup
+        Invoke-Command -ScriptBlock { sz a -bb0 -t7z $args[0] "$HOME\OneDrive - Seattle Pacific University"
+            } -ArgumentList @($backup_file)
+    }
+    
 
     if (!($noupload)) {
 

+ 1 - 0
exclude_from_sync.list

@@ -15,4 +15,5 @@
 */Documents/My Music/
 */Documents/My Pictures/
 */Documents/My Videos/
+*/OneDrive - Seattle Pacific University/
 *ntuser*