diff options
author | Ryan Kavanagh <rak@debian.org> | 2018-07-20 17:30:55 -0400 |
---|---|---|
committer | Ryan Kavanagh <rak@debian.org> | 2018-07-20 17:30:55 -0400 |
commit | 9eb71b3ade2d1e6e0f7d3fa4f1d55a136d68d39f (patch) | |
tree | 0bdfdacbd9cfed3be405fc9caf39680812c102c9 /bin | |
parent | Update .ssh/known_hosts.d/debian (diff) |
Added backup scripts
Diffstat (limited to '')
-rwxr-xr-x | bin/wd-bak | 14 | ||||
-rwxr-xr-x | bin/wd-mount | 15 |
2 files changed, 29 insertions, 0 deletions
diff --git a/bin/wd-bak b/bin/wd-bak new file mode 100755 index 0000000..95b122e --- /dev/null +++ b/bin/wd-bak @@ -0,0 +1,14 @@ +#!/bin/sh + +wd-mount + +if ! mount | grep /media/wd-bak > /dev/null ; then + echo "/media/wd-bak not mounted" + exit 1 +fi + +rsync -avhHP --delete-after /media/wd/* /media/wd-bak + +sudo umount /media/wd-bak +sudo cryptdisks_stop wd-bak +sudo cryptdisks_stop wd-bak-work diff --git a/bin/wd-mount b/bin/wd-mount new file mode 100755 index 0000000..6288385 --- /dev/null +++ b/bin/wd-mount @@ -0,0 +1,15 @@ +#!/bin/sh + +if ! mount | grep /media/wd > /dev/null ; then + if [ -e /dev/disk/by-uuid/71bc8a1f-1942-4341-8ce1-8f8f3bf42d1a ]; then + sudo cryptdisks_start wd && mount /dev/mapper/wd + fi +fi + +if ! mount | grep /media/wd-bak > /dev/null ; then + if [ -e /dev/disk/by-uuid/68b52a2b-2be5-4d40-98ba-c8469da50f1f ]; then + sudo cryptdisks_start wd-bak-work && mount /dev/mapper/wd-bak-work + elif [ -e /dev/disk/by-uuid/49491f12-45ec-4f3f-9f70-73a94149aaf2 ]; then + sudo cryptdisks_start wd-bak && mount /dev/mapper/wd-bak + fi +fi |