Dreamhost Backup
Dreamhost has a few different backup systems in place and as an owner of multiple websites this is especially comfortable to hear.
Dreamhost’s first backup system was known as a snapshot backup system. This essentially meant that you could enter any directory and type cd . snapshot and you could have access to backup of your files – however at the time of this article – November 2009 – they are moving away from their snapshot backup system and now have two backup systems in place.
Dreamhost Backup Systems
- Domain Restore – The first backup system is called Domain Restore and as Dreamhost mentions it can be somewhat hit or miss. Â However, in the ideal cases Dreamhost will be able to restore your files. Â Really you need to make your own backups – thats the conclusion.
- Account Backup – Â Every thirty days, Dreamhost allows you to completely backup your whole website – meaning all domains, all users, all databases and files. Â This is 100% percent reliable but you have to remember to do this. Â One suggestion is to backup your website to your personal backup space.
- Personal Backup – Dreamhost offers you 50 GB of diskspace for personal backups. Dreamhost offers you unlimited hosting, however they don’t want you backing up all your personal information to their server. Â So you have two options as far as I see — go for an online backup service like mozy or use the personal backup space that Dreamhost provides to you.
Personally, what I do is to backup all my accounts across several webhosts to my personal Dreamhost personal backup space and then set this backup process on a cron job for two or three times a week.
Click here to save $50 with Dreamhost Coupon BEKIND
Dreamhost Backup Script
Here is a backup script that I use for backing up websites from various places to my Dreamhost Personal Backup space. Feel free to modify this to your own needs. You will have to choose SCP or FTP at the end to copy the backed up files to the Dreamhost backup server.
[cc lang=”bash” width=”600″ height=”1200″]
#!/bin/bash
### Setup Environment ###
DIRS=”/home/someone/public_html”
BACKUP=/home/someone/tmp/backupall.$$
NOW=$(date +”%Y-%m-%d”)
INCFILE=”/home/someone/tar-backup.dat”
DAY=$(date +”%a”)
FULLBACKUP=”Mon”
### MySQL Config ###
MUSER=”someone”
MPASS=”password”
MHOST=”localhost”
MYSQL=”/usr/bin/mysql”
MYSQLDUMP=”/usr/bin/mysqldump”
GZIP=”/bin/gzip”
### FTP Config ###
FTPD=”/backup”
FTPU=”b11111″
FTPS=”backup.dreamhost.com”
### Email Config ###
EMAILID=”email@domain.com”
##Remove previous backups
echo “remove previous backups”
rm -rf /home/someone/tmp/backup*
### FS Backup ###
[ ! -d $BACKUP ] && mkdir -p $BACKUP || :
##/usr/bin/mysql -u $MUSER -h $MHOST -p$MPASS -Bse ‘show databases’
### run full backup ###
FILE=”dreamhost-fs-full-$NOW.tar.gz”
tar -zcPf $BACKUP/$FILE $DIRS
### Start MySQL Backup ###
# Get all databases name
DBS=”$($MYSQL -u $MUSER -h $MHOST -p$MPASS -Bse ‘show databases’)”
echo $DBS
for db in $DBS
do
FILE=$BACKUP/dreamhost-mysql-$db.$NOW-$i.gz
$MYSQLDUMP -u $MUSER -h $MHOST -p$MPASS $db | $GZIP -9 > $FILE
done
echo “ftping”
### FTP Backup to Remote Server ###
#Start FTP backup using ncftp
ftp backup.dreamhost.com <
prompt
bin
mkdir $FTPD/$NOW
cd $FTPD/$NOW
lcd $BACKUP
mput *
bye
END_SCRIPT
# cd $BACKUP
# scp *.gz b11111@backup.dreamhost.com:$FTPD/$NOW ( you must setup SCP )
[/cc]