#!/bin/bash # # Program: Wordpress blog backup utility # # Author: Matty < matty91 at gmail dot com > # # Current Version: 1.0 # # Revision History: # Version 1.0 # - Original release # # Last Updated: 01-05-2007 # # License: # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. # # Purpose: wpbackup can be used to backup the tables that are # needed to recreate a wordpress database. The script # send the blog backup through email, and encrypts the # contents prior to transmission. PATH=/bin:/usr/bin:/usr/local/bin:/usr/sfw/bin export PATH DBNAME="dbname" DBPASS="password" DBUSER="dbuser" EMAIL=admin@something.com" SYMMETRICKEY="SOMESECUREWPASSWORD" mysqldump --opt -u ${DBUSER} -p${DBPASS} ${DBNAME} wp_categories \ wp_comments wp_linkcategories wp_links wp_options \ wp_post2cat wp_postmeta wp_posts wp_usermeta wp_users \ | openssl bf -e -a -k ${SYMMETRICKEY} \ mail -s "Wordpress backup (`/bin/date`)" ${EMAIL}