Jump to content


This topic is now archived and is closed to further replies.


Automatic, Scheduled Database Backup...

Recommended Posts



I'd like to run daily backups of my MySQL database. I understand I can backup to a directory on my server using something like this with CPanel & cron:


date=`date -I`; mysqldump -uDBUSER -pDBPASS --all-databases | gzip > /home/CPANEL/xbackup_$date.sql.gz


However, I have a problem. Firstly, I get 150MB of disk space and my DB is a few megs and growing, so running daily backups to the server will max out my space in no time at all. I'm assuming this can be overcome by just storing the latest backup, ie:


date=`date -I`; mysqldump -uDBUSER -pDBPASS --all-databases | gzip > /home/CPANEL/xbackup.sql.gz


but I don't know for sure if that would work as I dont really know anything about the commands being used or cron jobs.


What I really want to do however is automatically backup the database and then save it to my PC each night as my hosting is free and slightly undreliable - if the server disappears for any reason I dont want to lose everything. Is this possible, and how would I do it (please be straightforward in your reply, I know very little about this topic!). Up to now ive been manually doing it with phpMyAdmin but i'm sure there must be another way.



Share this post

Link to post
Share on other sites

I see this post is old but I too would love a solution like this.


My question is what happens if my hard drive (I only have one) crashes then those backups I had stored anyways is gone.


I prefer to dl them to my computer with plenty of space and then I occasionally burn them to DVD-R.


My server is A Fedora Linux server.


My system at home is a workstation running Win XP.

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.