
![]() |
![]() |
![]() |
|
|||||||
![]() |
![]() |
|
Welcome to Talk Arcades, the premier forum for arcade webmasters. You are currently viewing our boards as a guest. By joining our community you will be able to make posts, communicate privately with other arcade webmasters and participate in our Live Marketplace. Registration is easy, so please join us today! |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Contributing Member
Join Date: May 2008
Posts: 33
|
Is there a way to automatically backup my SQL database lets say every day?
I know there's some program that are available if I search on Google. But anybody uses any particular program for specific reasons? Thanks again! Vincent
__________________
![]() TG Motocross 3 | Max Dirt Bike | Worlds Hardest Game | Worlds Hardest Game 2 | Miniclips | Paper Mario World |
|
|
|
![]() |
![]() |
|
|
#2 (permalink) |
|
Senior Member
Join Date: Apr 2007
Posts: 351
|
create a script called "datadump.sh" with the following info
Code:
Edit myusername and mypassword and databasename accordingly in the above and chmod this file to 0755 or 0777 Next make a cronjob to run the above script , use the command "crontab -e" from a unix command line or use your control panel's cron editing cababilities and put the following info in it: (make sure to use your directory structure for the path of the script) Code:
Doing this of course will overwrite your backup file everyday so if you want to save it to a newly named file you'll need some more logic . Hope this helps!
__________________
~ |
|
|
|
![]() |
![]() |
|
|
#3 (permalink) | |
|
Contributing Member
Join Date: May 2008
Posts: 33
|
Quote:
__________________
![]() TG Motocross 3 | Max Dirt Bike | Worlds Hardest Game | Worlds Hardest Game 2 | Miniclips | Paper Mario World |
|
|
|
|
![]() |
![]() |
|
|
#4 (permalink) |
|
Contributing Member
Join Date: Jan 2008
Posts: 37
|
Whats the point of creating a file and then call the file thru a cron job if you can run the command on the cron?
![]() I'm doing like this (change the data on bold): I've created a cron job to every day of the week: mysqldump --opt -Q -u user --password=password database > /home/xxxxxxxx/public_html/whateverfolder/saturday.sql mysqldump --opt -Q -u user --password=password database > /home/xxxxxxxx/public_html/whateverfolder/sunday.sql mysqldump --opt -Q -u user --password=password database > /home/xxxxxxxx/public_html/whateverfolder/monday.sql etc... etc... etc... Now you'll have a backup of the database for every day of the week, if you want to restore the database to any day of the week, now thats easy!! Lets say you get your database "hacked" on Monday and you'll only noticed on Wednesday, now you can easily restore it to Sunday! ![]() |
|
|
|
![]() |
![]() |
|
|
#5 (permalink) | |
|
Senior Member
Join Date: Apr 2007
Posts: 351
|
Quote:
Either way works......I just do what's easiest for me. Another thing to think about with daily backups......you should be downloading it after you make it........leaving them on the server inevitably will prove to be no good if the server is hacked.
__________________
~ |
|
|
|
|
![]() |
![]() |
|
|
#6 (permalink) | |
|
Contributing Member
Join Date: Jan 2008
Posts: 37
|
Quote:
Yep, thats true, being daily or not you should always save backups in places other than the server. |
|
|
|
|
![]() |
![]() |
|
|
#7 (permalink) | |
|
Senior Member
Join Date: Apr 2007
Posts: 351
|
Quote:
mysqldump runs just fine without being in a web accessible directory. Edit......yes I see using your path to the dumps would be bad......because they go under the public_html...so potentially people could just have your data But I was never saying to do that.....
__________________
~ |
|
|
|
|
![]() |
![]() |
|
|
#8 (permalink) | |
|
Contributing Member
Join Date: Jan 2008
Posts: 37
|
Quote:
Anyway, as you said before either way works, and with the right knowledge both ways can be equal secure. Theres no need to start discussion! ![]() Edit...... perhaps i should'ed mention to password protect the folder... |
|
|
|
|
![]() |
![]() |
|
|
#9 (permalink) |
|
Senior Member
Join Date: Apr 2007
Posts: 351
|
You are right they probably don't that is why in my original post I put it under /home/username for them just trying to give him something that would work out of the box. No need to start a discussion that is for sure.
__________________
~ |
|
|
|
![]() |
![]() |
|
|
#10 (permalink) |
|
Moderator
Senior Member
|
If you host is good, they do daily/weekly/momnthly, backups of the whole site and stash it some where.
RickyG
__________________
Arcade Banner Exchange, game packs, top site, arcade script and forum for all of your arcade needs http://www.mibbi.com This site stinks!! www.farting.us Coming soon MibbiJr! |
|
|
|
![]() |
![]() |