home · contact · privacy
Add Bookworm borg migration script.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 8 Oct 2023 23:39:31 +0000 (01:39 +0200)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 8 Oct 2023 23:39:31 +0000 (01:39 +0200)
bookworm/setup_scripts/migrate_borg.sh [new file with mode: 0755]

diff --git a/bookworm/setup_scripts/migrate_borg.sh b/bookworm/setup_scripts/migrate_borg.sh
new file mode 100755 (executable)
index 0000000..9dad0bc
--- /dev/null
@@ -0,0 +1,14 @@
+#!/bin/sh
+set -e
+. ./misc.sh
+
+expect_n_args 1 "(old server IP)" "$@"
+old_server="$1"
+cp "${setup_scripts_dir}/prepare_to_meet_server.sh" /home/plom/
+chown plom:plom /home/plom/prepare_to_meet_server.sh
+su -lc "./prepare_to_meet_server.sh ${old_server}" plom
+read -p'Hit Enter when you are done.' ignore
+rm /home/plom/prepare_to_meet_server.sh
+cp "${setup_scripts_dir}/mirror_dir.sh" /home/plom/
+su -lc "./mirror_dir.sh ${old_server} /home/plom/borg" plom
+rm /home/plom/mirror_dir.sh