home · contact · privacy
Improve Pleroma migration scripts.
authorChristian Heller <c.heller@plomlompom.de>
Sun, 26 Jan 2020 22:59:39 +0000 (23:59 +0100)
committerChristian Heller <c.heller@plomlompom.de>
Sun, 26 Jan 2020 22:59:39 +0000 (23:59 +0100)
buster/setup_scripts/backup_pleroma.sh
buster/setup_scripts/migrate_pleroma.sh

index ae95b4dfa11b9d2b8f07400f2c6cd641cc020c1d..75a484ed4c3cece2663337213b4d30d6b3e1d234 100755 (executable)
@@ -6,7 +6,7 @@ set -x
 service pleroma stop
 su postgres -lc 'pg_dump -d pleroma --format=custom -f /tmp/pleroma.pgdump'
 cd /tmp
-mkdir pleroma_backup
+mkdir -p pleroma_backup
 mv pleroma.pgdump pleroma_backup
 cp -a /var/lib/pleroma/uploads pleroma_backup/uploads
 cp -a /etc/pleroma pleroma_backup/etc_files
index 5eefc39f561c05941592c07c13a6252601a026cb..80da33dfcd2b36cbe38e35a052d892b45afd1768 100755 (executable)
@@ -12,14 +12,10 @@ server_ip="$1"
 config_tree_prefix="${HOME}/config/buster"
 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
 
-# So we're only asked once …
-eval $(ssh-agent)
-ssh-add
-
 cd "${setup_scripts_dir}"
 ./prepare_to_meet_server.sh "${server_ip}"
+eval $(ssh-agent) && ssh-add
 read -p'Hit Enter when you are done.' ignore
-ssh plom@"${server_ip}" 'su -lc "cd config && git pull"'
-ssh plom@"${server_ip}" 'su -lc "cd config/buster/setup_scripts && ./backup_pleroma.sh"'
+ssh plom@"${server_ip}" 'su -lc "cd config && git pull && cd config/buster/setup_scripts && ./backup_pleroma.sh"'
 scp plom@"${server_ip}":~/pleroma_backup.tar /home/plom/pleroma_backup.tar
 ./restore_pleroma.sh