Last active
September 1, 2019 02:08
-
-
Save lewayotte/69da6660cb939caa8bff2ec6fbc7fc47 to your computer and use it in GitHub Desktop.
WordPress database backups for EasyEngine v4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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