Skip to content

Instantly share code, notes, and snippets.

@lewayotte
Last active September 9, 2020 16:59
Embed
What would you like to do?
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