#!/bin/sh . ./config-urls ( echo "export local_url=\"$local_ur\""; \ echo "export remote_url=\"$remote_url\""; \ cat config "$2" \ ) | ssh root@"$local_url" -T /bin/sh ( echo "export local_url=\"$remote_url\""; \ echo "export remote_url=\"$local_url\""; \ cat config "$2" \ ) | ssh root@"$remote_url" -T /bin/sh db_file="$wp_path/data.sql" wp db export --dbuser=wordpress --dbpass=$db_pass --add-drop-table --alow-root "$db_file" tar czf /tmp/wordpress.tar.gz "$wp_path" # scp rm "$db_file" rm /tmp/wordpress.tar.gz