8e3363a5c0c8

scripts
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 19 Jul 2018 00:16:12 +0000
parents 114bb5f00e48
children bbfb324ad399
branches/tags (none)
files bin/backup bin/backup-backblaze bin/backup-local bin/mount-encrypted-stick bin/rb bin/rl bin/unmount-encrypted-stick

Changes

--- /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
--- /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
--- /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
--- /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"
--- /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 \
+       "$@"
--- /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 \
+       "$@"
--- /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"