Jump to content


Photo

Automatic, Scheduled Database Backup...


  • Please log in to reply
1 reply to this topic

#1 Kingskin

Kingskin
  • Members
  • PipPip
  • Member
  • 18 posts

Posted 18 November 2005 - 09:29 PM

Hi,

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.

Thanks

#2 crimsonmoon

crimsonmoon
  • Members
  • PipPipPip
  • Advanced Member
  • 36 posts

Posted 11 January 2006 - 03:34 PM

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.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users