Guy Rutenberg

Keeping track of what I do

Archive for the ‘backup’ tag

Improved FTP Backup for WordPress

with 25 comments

This script backups both the database and files of a WordPress blog into a remote FTP server (while keeping a local copy). It’s an update of my WordPress Backup to FTP script. The main changes are auto-detecting database settings and better support for caching plugins (specifically WP-Cache). The new version makes it easier to backup multiple WordPress blogs to the same FTP server.
Read the rest of this entry »

Written by Guy

February 28th, 2010 at 8:38 am

Posted in Bash,Projects,Wordpress

Tagged with , ,

Using Duplicity and Amazon S3 – Notes and Examples

without comments

Up until now I’ve been doing my backups to Amazon S3 using my s3backup script. While it’s simple and does what I needed at the time, I’ve decided to cut some of the costs by switching to incremental backups.
Read the rest of this entry »

Written by Guy

December 12th, 2009 at 12:00 pm

Posted in Tips

Tagged with , ,

WordPress Backup to FTP

with 21 comments

Update: A newer version of the script is available.

This script allows you to easily backup your WordPress blog to an FTP server. It’s actually a modification of my WordPress Backup to Amazon S3 Script, but instead of saving the backup to Amazon S3 it uploads it to an FTP server. Another update is that now the SQL dump includes the database creation instructions so you don’t need to create it manually before restoring from the backup.

Although I’ve written it with WordPress in mind (to creates backups of my blog), it isn’t WordPress specific. It can be used to backup any website that consists of a MySQL database and files. I’ve successfully used it to backup MediaWiki installation.
Read the rest of this entry »

Written by Guy

January 6th, 2009 at 4:46 pm

Posted in Bash,Wordpress

Tagged with , ,

Backup a SourceForge hosted SVN repository – sf-svn-backup

with 4 comments

SourceForge urges their users to backup the code repositories of their projects. As I have several projects hosted with SourceForge, I should do it too. Making the backups isn’t complicated at all, but because it isn’t automated properly, I’ve been lazy with it.

sf-svn-backup was written in order to simply automate the process. The script is pretty simple to use, just pass as the first argument the project name and the script will write down to stdout the dump file.

For example:

sf-svn-backup openyahtzee > openyahtzee.dump

The project name should be it’s UNIX name (e.g. openyahtzee and not Open Yahtzee). Because the script writes the dump file directly to stdout it’s easy to pipe the output first through a compression program such as gzip to create compressed SVN dump files.

Written by Guy

December 12th, 2008 at 8:49 pm

Posted in Bash

Tagged with ,

s3backup – Easy backups of Folders to Amazon S3

without comments

This is an updated version of my previous backups script – Backup Directories to Amazon S3 Script. The new script works much better and safer. Unlike the old script, the new one creates the tarballs in a temporary file under /tmp, and allows more control over the backup process.

Read the rest of this entry »

Written by Guy

October 21st, 2008 at 10:24 pm

Posted in Bash

Tagged with ,

WordPress Backup to Amazon S3 Script

with 17 comments

This is an updated version of my WordPress Backup Script. The new version basically does the same thing: backup up a wordpress blog (actually any site that consists of files and a MySQL database). The new thing about the script is that instead of only saving the backup locally, it also uploads it to Amazon S3.

Read the rest of this entry »

Written by Guy

October 11th, 2008 at 12:19 pm

Posted in Bash,Wordpress

Tagged with , ,

Retrieving Google’s Cache for a Whole Website

with 39 comments

Some time ago, as some of you noticed, the web server that hosts my blog went down. Unfortunately, some of the sites had no proper backup, so some thing had to be done in case the hard disk couldn’t be recovered. My efforts turned to Google’s cache. Google keeps a copy of the text of the web page in it’s cache, something that is usually useful when the website is temporarily unavailable. The basic idea is to retrieve a copy of all the pages of a certain site that Google has a cache of.
Read the rest of this entry »

Written by Guy

October 2nd, 2008 at 11:07 pm

Posted in Python

Tagged with ,

WordPress Backup Script

with one comment

This is a small script I’ve written to automate my server-side backups of my blogs. It creates a backup of both the database and the actual WordPress files.

#!/bin/bash
 
# (C) 2008 Guy Rutenberg - http://www.guyrutenberg.com
# This is a script that creates backups of blogs.
 
DB_NAME=guy_blog
DB_USER=guy_root
DB_PASS=****
DB_HOST=localhost
 
#no trailing slash
BLOG_DIR=/home/guyru/guyrutenberg.com
BACKUP_DIR=/home/guyru/backups
 
 
echo -n "dumping database... "
mysqldump --user=${DB_USER} --password=${DB_PASS} --host=${DB_HOST} ${DB_NAME} \
 | bzip2 -c > ${BACKUP_DIR}/${DB_NAME}-$(date +%Y%m%d).sql.bz2
if [ "$?" -ne "0" ]; then
	echo -e "\nmysqldump failed!"
	exit 1
fi
echo "done"
 
 
echo -n "Creating tarball... "
tar -cjf ${BACKUP_DIR}/${BLOG_DIR##*/}-$(date +%Y%m%d).tar.bz2 ${BLOG_DIR}
if [ "$?" -ne "0" ]; then
	echo -e "\ntarball creation failed!"
	exit 1
fi
echo "done"

Read the rest of this entry »

Written by Guy

May 7th, 2008 at 11:15 am

Posted in Bash,Tips,Wordpress

Tagged with ,

Backup Directories To Amazon S3 Script

without comments

This is a small script I wrote today, to automate my backups, which I do on Amazon S3. This is fairly short, yet useful bash script that utilize the s3cmd to do the actual sending of the files.
Read the rest of this entry »

Written by Guy

March 1st, 2008 at 11:12 pm

Posted in Bash,Linux,Projects,Tips

Tagged with ,