s3backup – Easy Backups of Folders to Amazon S3

This is an updated version of my previous backup script – Backup Directories to Amazon S3 Script. The new script works much better and is 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.

Continue reading s3backup – Easy Backups of Folders to Amazon S3

WordPress Backup to Amazon S3 Script

This is an updated version of my WordPress Backup Script. The new version basically does the same thing: backs 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.

Continue reading WordPress Backup to Amazon S3 Script

WordPress Backup Script

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=
DB_USER=
DB_PASS=
DB_HOST=

#no trailing slash
BLOG_DIR=
BACKUP_DIR=


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"

Continue reading WordPress Backup Script

Convert PNMs to DjVu

I’ve decided to scan some notebooks. After researching a bit, I’ve decided to use DjVu instead of PDF, which I normally use. I’ve chosen to use DjVu because it offered great quality with a very good compression rate (~26KB per page) in lineart (black and white).

While XSane can natively save a multipage project into PDF, it can’t do so for DjVu. So the solution is to use the PNMs generated by XSane and convert them using the command line tools offered by DjVuLibre to bundle them together into a DjVu file. As you can guess, doing this manually is pretty hard work. To make this task easier, I’ve written a small bash script to automate the process.
Continue reading Convert PNMs to DjVu