Skip to content

Instantly share code, notes, and snippets.

View rbk's full-sized avatar

Richard Keller rbk

View GitHub Profile
@rbk
rbk / backup.sh
Created July 12, 2016 15:27 — forked from bradt/backup.sh
Simple Remote Backups for WordPress
#!/bin/bash
BUCKET_NAME=${1-''}
# Get upload folder path using WP-CLI
# We use --url=http://blah.com in our WP-CLI commands so that we don't get the PHP warning about HTTP_HOSTS
UPLOADS_PATH=$(wp eval '$upload_dir = wp_upload_dir(); echo $upload_dir["basedir"];' --url=http://blah.com 2>&1)
if [[ $UPLOADS_PATH =~ Error ]]
then