mirror of
https://github.com/Matir/skel.git
synced 2026-05-26 05:29: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
|
||||
Reference in New Issue
Block a user