From: Christian Heller Date: Fri, 14 Feb 2020 23:11:50 +0000 (+0100) Subject: Fix. X-Git-Url: https://plomlompom.com/repos/%7B%7B%20web_path%20%7D%7D/cards/%7B%7Bcard_id%7D%7D/task?a=commitdiff_plain;h=6090347534db9b20543938f611a427076249dc79;p=config Fix. --- 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