# HG changeset patch # User Steve Losh # Date 1531959372 0 # Node ID 8e3363a5c0c8d7ba88d001e16fb39f879c3e7bbc # Parent 114bb5f00e48e2a5aed091c90c18d45ffc288acc scripts diff -r 114bb5f00e48 -r 8e3363a5c0c8 bin/backup --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/backup Thu Jul 19 00:16:12 2018 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -euo pipefail + +backup-local +backup-backblaze diff -r 114bb5f00e48 -r 8e3363a5c0c8 bin/backup-backblaze --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/backup-backblaze Thu Jul 19 00:16:12 2018 +0000 @@ -0,0 +1,10 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source /home/sjl/.restic-backblaze-creds + +restic --repo b2:backups-ouroboros:restic-repo \ + --exclude-file=/home/sjl/src/dotfiles/restic/excludes.txt \ + --password-file /home/sjl/.restic-password-backblaze \ + backup /home/sjl diff -r 114bb5f00e48 -r 8e3363a5c0c8 bin/backup-local --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/backup-local Thu Jul 19 00:16:12 2018 +0000 @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -euo pipefail + +restic --repo /backup/restic-repo \ + --exclude-file=/home/sjl/src/dotfiles/restic/excludes.txt \ + --password-file /home/sjl/.restic-password-local \ + backup /home/sjl diff -r 114bb5f00e48 -r 8e3363a5c0c8 bin/mount-encrypted-stick --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/mount-encrypted-stick Thu Jul 19 00:16:12 2018 +0000 @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -euo pipefail + +sudo cryptsetup luksOpen "/dev/$1" "$1_crypt" +sudo mkdir -p "/media/sjl/encrypted_drive_$1" +sudo mount "/dev/mapper/$1_crypt" "/media/sjl/encrypted_drive_$1" diff -r 114bb5f00e48 -r 8e3363a5c0c8 bin/rb --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/rb Thu Jul 19 00:16:12 2018 +0000 @@ -0,0 +1,9 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source /home/sjl/.restic-backblaze-creds + +restic --repo b2:backups-ouroboros:restic-repo \ + --password-file /home/sjl/.restic-password-backblaze \ + "$@" diff -r 114bb5f00e48 -r 8e3363a5c0c8 bin/rl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/rl Thu Jul 19 00:16:12 2018 +0000 @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +set -euo pipefail + +restic --repo /backup/restic-repo \ + --password-file /home/sjl/.restic-password-local \ + "$@" diff -r 114bb5f00e48 -r 8e3363a5c0c8 bin/unmount-encrypted-stick --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/bin/unmount-encrypted-stick Thu Jul 19 00:16:12 2018 +0000 @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +set -euo pipefail + +sudo umount "/media/sjl/encrypted_drive_$1" +sudo cryptsetup luksClose "$1_crypt"