Last active
September 9, 2020 16:59
-
-
Save lewayotte/84f08c897faf771055a902868d61124d to your computer and use it in GitHub Desktop.
Automated EasyEngine WordPress Backups
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/wo site list | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[mGK]//g"`; do | |
cd /var/www/$x/htdocs/ | |
/usr/local/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