dotfiles

My personal dotfiles 💠️

backup (2358B)

      1 #!/bin/sh
      2 # Backup my relevant data in my backup drive.
      3 # 
      4 # Copyright (C) 2020 Pablo Emilio Escobar Gaviria.
      5 # Free use of this software is granted under the terms of the GPL-3.0 License.
      6 
      7 date="$(date '+%Y-%m-%d')"
      8 
      9 # Backup the most important directories into an archive named after
     10 # the machine this script is currently running on:
     11 borg create                                                                \
     12   --verbose                                                                \
     13   --filter AME                                                             \
     14   --list                                                                   \
     15   --stats                                                                  \
     16   --show-rc                                                                \
     17   --compression lz4                                                        \
     18   --exclude-caches                                                         \
     19   --exclude-from "$HOME/.local/share/excludefile"                          \
     20   "/run/media/pablo/Seagate Backup Plus Drive/Backups/::$(hostname)-$date" \
     21   "$HOME/.ssh"                                                             \
     22   "$HOME/Archive"                                                          \
     23   "$HOME/Documents"                                                        \
     24   "$HOME/Passwords"                                                        \
     25   "$HOME/Pictures"                                                         \
     26   "$HOME/Music"                                                            \
     27   "$HOME/Videos"                                                           \
     28   "$HOME/TODO.md"                                                          \
     29   "$HOME/.config"                                                          \
     30   "$HOME/.local/share/excludefile"                                         \
     31   "$TEXMFHOME"                                                             \
     32   "$HOME/.local/bin"                                                       \
     33 
     34 gpg --export --armor pablo-escobar@riseup.net \
     35   > '/run/media/pablo/Seagate Backup Plus Drive/pablo.asc' 
     36 
     37 gpg --export-secret-keys --armor pablo-escobar@riseup.net \
     38   > '/run/media/pablo/Seagate Backup Plus Drive/pablo-secret.asc' 
     39 
     40 gpg --export-ownertrust \
     41   > '/run/media/pablo/Seagate Backup Plus Drive/trustdb.txt' 
     42