From 0701945225dbdfa8752726d325aeab47c297b97a Mon Sep 17 00:00:00 2001 From: Crony Akatsuki Date: Tue, 3 Jan 2023 17:16:39 +0100 Subject: [PATCH] Simple backup scripts. --- backuper | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 backuper diff --git a/backuper b/backuper new file mode 100755 index 0000000..16d1668 --- /dev/null +++ b/backuper @@ -0,0 +1,20 @@ +#!/bin/env bash + +copy () { + while read Line; do + echo "Syncing $(basename $Line)" + rsync -ahAX -v --delete "$Line" $HOME/.local/backup + done <<< "$(cat $HOME/.config/rsync/backup-list)" +} + +encrypt () { + x=$(date +%d.%m.%y) + cd "$HOME/.local" + tar cv -I"zstd -19 -T0" -f "$HOME/.local/cloud/backup-$x.tar.zst" "backup" + gpg -c --no-symkey-cache --cipher-algo AES256 -o "$HOME/.local/cloud/backup-$x.tar.zst.gpg" "$HOME/.local/cloud/backup-$x.tar.zst" + shred -uzn3 "$HOME/.local/cloud/backup-$x.tar.zst" +} + +[ -z "$@" ] && exit 1 +[ "$1" = "copy" ] && copy +[ "$1" = "encrypt" ] && encrypt