Skip to content

Instantly share code, notes, and snippets.

@lewayotte
Last active September 1, 2019 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lewayotte/69da6660cb939caa8bff2ec6fbc7fc47 to your computer and use it in GitHub Desktop.
Save lewayotte/69da6660cb939caa8bff2ec6fbc7fc47 to your computer and use it in GitHub Desktop.
WordPress database backups for EasyEngine v4
#!/bin/bash
if [ ! -d /var/backups/wpdb/ ]; then
mkdir -p /var/backups/wpdb/
fi
for x in `/usr/local/bin/ee site list --format=text | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"`; do
cd /opt/easyengine/sites/$x/app/htdoc
/usr/bin/wp --allow-root db export --add-drop-table /var/backups/wpdb/$x.sql
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment