Automated SQL backup problem

apps

#1

I’m having issues with setting up an automated SQL backup.

I’m following the instructions from http://wiki.dreamhost.com/Automatic_Backup

My script is as follows with my private information removed

#!/bin/bash
cd /home/username/backup/
mkdir mysql
suffix=$(date +%y%m%d)
mysqldump --opt -uusername -ppassword -h sql.domain.com dbname > mysql/sitename_backup_.$suffix.sql
tar zcf archives/mysql_backup.$suffix.tar.gz mysql/*
mutt email@myemail.com -a /home/username/backup/archives/mysql_backup.$suffix.tar.gz -s "MySQL Backup"
rm -r mysql/

I get no errors. Checking behind the scenes, I found both the sql backup being grabbed, and it being successfully zipped. The freezup happens on the mutt command. I tried running it independently and it yielded the same results. Those results being a whole page of white nothingness in the command prompt and a complete stall.

I tried letting it run, thinking it may need time to complete, but it is a full stall.

Any help?


#2

[code]#!/bin/bash

email=“you@yourdomain”

dbhost="sql.yourdomain.com"
dbname="db_name"
dbuser="db_user"
dbpass=“db_pass”

mkdir -p ~/archives
cd ~/archives
suffix=$(date +%y%m%d)
echo “SQL Backup of “$dbname” attached” >> tmp.txt
mysqldump --opt -u $dbuser -p$dbpass -h $dbhost $dbname > SQL_"$dbname"$suffix.sql
tar zcf SQL_Backup
"$dbname"$suffix.tar.gz *.sql
mutt -s “SQL Backup of “$dbname”” -a SQL_Backup
"$dbname"_$suffix.tar.gz $email < tmp.txt
rm -rf {*.sql,tmp.txt}
[/code]

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

Thanks you tons. Thats working great for me