From 6090347534db9b20543938f611a427076249dc79 Mon Sep 17 00:00:00 2001 From: Christian Heller Date: Sat, 15 Feb 2020 00:11:50 +0100 Subject: [PATCH] Fix. --- buster/setup_scripts/backup_app.sh | 2 +- buster/setup_scripts/migrate_app.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buster/setup_scripts/backup_app.sh b/buster/setup_scripts/backup_app.sh index ada3eb1..e3f22e4 100755 --- a/buster/setup_scripts/backup_app.sh +++ b/buster/setup_scripts/backup_app.sh @@ -14,7 +14,7 @@ shift 2 cd /tmp rm -rf "/tmp/${app}_backup" -app "${app}" stop +service "${app}" stop su postgres -lc "pg_dump -d ${db_name} --format=custom -f ${app}_backup/pgdump" for target in "$@"; do diff --git a/buster/setup_scripts/migrate_app.sh b/buster/setup_scripts/migrate_app.sh index c0e1637..5f19598 100755 --- a/buster/setup_scripts/migrate_app.sh +++ b/buster/setup_scripts/migrate_app.sh @@ -6,7 +6,7 @@ if [ "$#" -lt 4 ]; then echo 'Need at least four arguments: old server IP, service name, DB name, and backup directory names.' false fi -if [ ! "$1" = "pleroma" ] && [ ! "$1" = "peertube" ]; then +if [ ! "$2" = "pleroma" ] && [ ! "$2" = "peertube" ]; then echo "Need legal service name (pleroma or peertube)." false fi @@ -23,6 +23,6 @@ cd "${setup_scripts_dir}" read -p'Hit Enter when you are done.' ignore eval $(ssh-agent) && ssh-add echo 'Enter password for root on target server next.' -ssh plom@"${server_ip}" 'su -lc "cd config/buster/setup_scripts && git pull && ./backup_${app}.sh ${app} ${db_name} $@"' +ssh plom@"${server_ip}" "su -lc \"cd config/buster/setup_scripts && git pull && ./backup_app.sh ${app} ${db_name} $@\"" scp plom@"${server_ip}":~/${app}_backup.tar /home/plom/${app}_backup.tar ./restore_${app}.sh -- 2.30.2