Kingskin Posted November 18, 2005 Share Posted November 18, 2005 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 Quote Link to comment https://forums.phpfreaks.com/topic/2893-automatic-scheduled-database-backup/ Share on other sites More sharing options...
crimsonmoon Posted January 11, 2006 Share Posted January 11, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/2893-automatic-scheduled-database-backup/#findComment-10814 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.