mirror of
https://github.com/Matir/skel.git
synced 2026-05-25 21:19:09 -07:00
Add bin/restic-backup.sh
This commit is contained in:
37
bin/restic-backup.sh
Executable file
37
bin/restic-backup.sh
Executable file
@@ -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
|
||||||
Submodule dotfiles/vim/pack/matir/opt/solarized8 updated: 6178a07f44...7b6399093c
Submodule dotfiles/vim/pack/matir/start/editorconfig updated: 8b7da79e9d...8f6eba5fd6
Submodule dotfiles/vim/pack/matir/start/fugitive updated: 64d6cafb9d...2a53d79248
Reference in New Issue
Block a user