Skip to content

Instantly share code, notes, and snippets.

@lewayotte
Last active September 9, 2020 16:59
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/84f08c897faf771055a902868d61124d to your computer and use it in GitHub Desktop.
Save lewayotte/84f08c897faf771055a902868d61124d to your computer and use it in GitHub Desktop.
Automated EasyEngine WordPress Backups
#!/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