5 if [ "$#" -lt 4 ]; then
6 echo 'Need at least four arguments: old server IP, service name, DB name, and backup directory names.'
9 if [ ! "$1" = "pleroma" ] && [ ! "$1" = "peertube" ]; then
10 echo "Need legal service name (pleroma or peertube)."
18 config_tree_prefix="${HOME}/config/buster"
19 setup_scripts_dir="${config_tree_prefix}/setup_scripts"
21 cd "${setup_scripts_dir}"
22 ./prepare_to_meet_server.sh "${server_ip}"
23 read -p'Hit Enter when you are done.' ignore
24 eval $(ssh-agent) && ssh-add
25 echo 'Enter password for root on target server next.'
26 ssh plom@"${server_ip}" 'su -lc "cd config/buster/setup_scripts && git pull && ./backup_${app}.sh ${app} ${db_name} $@"'
27 scp plom@"${server_ip}":~/${app}_backup.tar /home/plom/${app}_backup.tar