« Creating Custom Error Pages | Main | Next Generation File Uploader »

Get Your Database Backup Sent to You Via Email

It's good practice to backup your mysql database often. How often depends on how important your data is.

I've been using a utility called dbsender to backup my database and send it to me via email for a few of months now but have never received the email attachment. I get the email saying it's attached, but no attachment. I know the database backups are in the dbsender folder and my database is getting backed up weekly. If ever anything goes wrong, I'll always have a recent backup.

Today, however, I investigated the email sending part of the script, and to my disgust I realised the problem all along has been permissions. After reading a post on a hosting forum, I changed the file and folder permissions to 770, rather than 777 as was recommended in the script, and everything is working. Such a simple little fix that's been a problem for months.

I set it up outside of my public_html directory and made the changes to the file as explained in the comments.

I then set up a crontab to run it once a week, you can do this daily if you wish, and used

php -q /home/username/dbsender/dbsender.php > /dev /null

as the command. I set the permissions to 770 on the actual file and the folder.

When the file runs it will use gzip to compress the file then send the file to me via email or ftp.


TrackBack

TrackBack URL for this entry:
http://www.bestoday.com.au/cgi-bin/mt/mt-tb.cgi/537

Leave a comment

Verification (needed to reduce spam):

September 2008

Sun Mon Tue Wed Thu Fri Sat
1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30

Subscribe

Enter your Email


Preview | Powered by FeedBlitz

Google AdSense

The Playground

DreamHost

GeoURL


Creative Commons License
This weblog is licensed under a Creative Commons License.