Backup - marco1475/linux-htpc GitHub Wiki

Synchronizing Google Drive

  1. Install the drive program from odeke-em from the AUR.

    • This will install Go on your machine.
  2. Initialize drive:

     drive init <google_drive_dir>
    
    • Open the URL provided on the command line in a browser logged into your Google account, give drive permission to access your Google Drive, and copy and paste the OAuth response key into the command line.
  3. Create a .driveignore file in your local <google_drive_dir>:

     ^.*\.gd$
     ^.*\.driveignore$
     ^.*\.driverc$
     <any files / directories you want ignored>
    
  4. Create a .driverc file in your local <google_drive_dir>:

     desktop-links=false
     export=pdf,odt,ods
     explicitly-export=true
    
    • These settings:
      • Prevent the creation of .desktop files that tell desktop managers which applications to use to open Google Docs, Sheets, etc.
      • Always export all Google Docs, Sheets, etc. as PDF and ODT or ODS files respectively.
        • The exported files will be created in a <filename>_exports directory next to the file.
        • Do not add the export directories to your .driveignore (e.g. by adding ^.*_exports/.*$) because they wouldn't be removed if a remote file gets deleted.
        • Do not execute a drive push because it would upload the <filename>_exports directories to the cloud. (This shouldn't be a problem since we're using drive only to backup the cloud data.)
      • Re-export all Google Docs, Sheets, etc. even if they didn't change.
        • This is important for managing the exported files and keeping them in sync with the remote files.
        • A drive pull would:
          1. Delete all exported files (because they don't exist remotely).
          2. Download any modified Google Docs, Sheets, etc.
          3. Export all Google Docs, Sheets, etc., even the unmodified ones, to re-create the exported files that were deleted in step 1.
  5. Download Google Drive content:

     cd <google_drive_dir>
     drive pull
    

Backing Up to Local External Drive

  1. Install rsync:

     sudo pacman -S rsync
    
  2. Connect and mount the external drive and run:

     rsync -aAHhv --delete --progress <source_dir> <destination_dir>
    

Partitioning table

Disk /dev/sda: 111.8GiB

Device Start End Sectors Size Type /dev/sda1 2048 2099199 2097152 1G EFI System /dev/sda2 2099200 127928319 125829120 60G Linux filesystem

Disk /dev/sdb: 3.7TiB

Device Start End Sectors Size Type /dev/sdb1 2048 7813832334 7813830287 3.7T Linux RAID

Disk /dev/sdc: 3.7TiB

Device Start End Sectors Size Type /dev/sdc1 2048 7813832334 7813830287 3.7T Linux RAID

Disk /dev/md127: 3.7TiB

⚠️ **GitHub.com Fallback** ⚠️