From f6573e30b27fcf6fd1573dd0f34d497180d3995f Mon Sep 17 00:00:00 2001 From: David Tomaschik Date: Tue, 29 Oct 2024 16:45:28 -0700 Subject: [PATCH] Add bin/restic-backup.sh --- bin/restic-backup.sh | 37 ++++++++++++++++++++++ dotfiles/vim/pack/matir/opt/solarized8 | 2 +- dotfiles/vim/pack/matir/start/editorconfig | 2 +- dotfiles/vim/pack/matir/start/fugitive | 2 +- dotfiles/vim/pack/matir/start/surround | 2 +- 5 files changed, 41 insertions(+), 4 deletions(-) create mode 100755 bin/restic-backup.sh diff --git a/bin/restic-backup.sh b/bin/restic-backup.sh new file mode 100755 index 0000000..07acd05 --- /dev/null +++ b/bin/restic-backup.sh @@ -0,0 +1,37 @@ +#!/bin/bash + +set -ue + +export RESTIC_DEFAULT_BE="google" +export RESTIC_PASSWORD_FILE=${HOME}/.restic-password + +case "${RESTIC_BACKEND:=${RESTIC_DEFAULT_BE}}" in + google) + export GOOGLE_PROJECT_ID=systemoverlord.com:systemoverlord + export GOOGLE_APPLICATION_CREDENTIALS=${HOME}/.config/boto/restic-creds.json + export RESTIC_REPOSITORY="gs:systemoverlord-backups-scar-2:/" + ;; + b2) + . ${HOME}/.restic-backups-scar-creds + export AWS_ACCESS_KEY_ID + export AWS_SECRET_ACCESS_KEY + export RESTIC_REPOSITORY="s3:s3.us-west-004.backblazeb2.com/systemoverlord-backups-scar" + ;; + *) + echo "Unknown restic backend $RESTIC_BACKEND" >&2 + exit 1 + ;; +esac + +cd ${HOME} + +if [ -z "${1}" ] ; then + + restic backup \ + --files-from "${HOME}/.restic-backup" \ + --limit-upload 5000 \ + --limit-download 10000 + +else + restic "$@" +fi diff --git a/dotfiles/vim/pack/matir/opt/solarized8 b/dotfiles/vim/pack/matir/opt/solarized8 index 6178a07..7b63990 160000 --- a/dotfiles/vim/pack/matir/opt/solarized8 +++ b/dotfiles/vim/pack/matir/opt/solarized8 @@ -1 +1 @@ -Subproject commit 6178a07f442a1fe559673cef6ac2b7031ab21edb +Subproject commit 7b6399093c090ef931e9a4ba031bff90fb7c8de1 diff --git a/dotfiles/vim/pack/matir/start/editorconfig b/dotfiles/vim/pack/matir/start/editorconfig index 8b7da79..8f6eba5 160000 --- a/dotfiles/vim/pack/matir/start/editorconfig +++ b/dotfiles/vim/pack/matir/start/editorconfig @@ -1 +1 @@ -Subproject commit 8b7da79e9daee7a3f3a8d4fe29886b9756305aff +Subproject commit 8f6eba5fd6c306e0480ea72917902a2bde162d73 diff --git a/dotfiles/vim/pack/matir/start/fugitive b/dotfiles/vim/pack/matir/start/fugitive index 64d6caf..2a53d79 160000 --- a/dotfiles/vim/pack/matir/start/fugitive +++ b/dotfiles/vim/pack/matir/start/fugitive @@ -1 +1 @@ -Subproject commit 64d6cafb9dcbacce18c26d7daf617ebb96b273f3 +Subproject commit 2a53d7924877b38b3d82fba188fd9053bfbc646e diff --git a/dotfiles/vim/pack/matir/start/surround b/dotfiles/vim/pack/matir/start/surround index 3d188ed..f51a26d 160000 --- a/dotfiles/vim/pack/matir/start/surround +++ b/dotfiles/vim/pack/matir/start/surround @@ -1 +1 @@ -Subproject commit 3d188ed2113431cf8dac77be61b842acb64433d9 +Subproject commit f51a26d3710629d031806305b6c8727189cd1935