]> piware.de Git - bin.git/commitdiff
backup: Run check through ssh
authorMartin Pitt <martin@piware.de>
Sat, 7 Jan 2023 18:04:40 +0000 (19:04 +0100)
committerMartin Pitt <martin@piware.de>
Sat, 7 Jan 2023 18:04:40 +0000 (19:04 +0100)
This is much faster and more efficient, as it doesn't need to transfer
the files. It requires transfering the passphrase though.

backup

diff --git a/backup b/backup
index bbca65e02316c5148e3bd5b5fb554292ad41de6a..421fde9033ce1917c4e6aa8fc3433bb9e1f7aa1f 100755 (executable)
--- a/backup
+++ b/backup
@@ -40,5 +40,9 @@ $RESTIC backup --exclude-file=$HOME/.config/backup-ignore $HOME || fail
 # TODO: forget --prune policy: https://restic.readthedocs.io/en/stable/060_forget.html
 notify-send "Backup finished successfully"
 
-$RESTIC check || fail "BACKUP CHECK FAILED!"
+scp .config/backup-passphrase piware.de:.cache/
+ssh piware.de chmod u+w .cache/backup-passphrase
+trap "ssh piware.de shred -u .cache/backup-passphrase" EXIT INT QUIT PIPE
+ssh piware.de restic --password-file .cache/backup-passphrase --repo backup/restic check || fail "BACKUP CHECK FAILED!"
+
 notify-send "Backup checked successfully"