dev-scripts/wp-export.sh

24 lines
530 B
Bash
Raw Normal View History

2020-06-08 18:59:06 +00:00
#!/bin/sh
2020-06-12 22:41:13 +00:00
. ./config-urls
2020-06-08 18:59:06 +00:00
2020-06-12 22:41:13 +00:00
(
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=$wp_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