-
Website
http://www.tech-recipes.com/ -
Original page
http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/ -
Subscribe
All Comments -
Community
-
Top Commenters
-
davak
83 comments · 1 points
-
Web Design
3 comments · 1 points
-
danishbacker
9 comments · 1 points
-
flexinfo
11 comments · 1 points
-
Tonychelle
4 comments · 1 points
-
-
Popular Threads
-
Facebook: How To Get Only Status Updates on Your FB Home Page
1 week ago · 4 comments
-
Firefox: Enable Case Sensitive Searches When Using Find (Ctrl+F)
5 days ago · 1 comment
-
Windows 7: How To Disable Live Preview for Taskbar Thumbnails
2 weeks ago · 2 comments
-
Gmail: How to block a sender from your inbox
3 weeks ago · 3 comments
-
Our first iPhone game GreenThumb available in the App Store
3 weeks ago · 2 comments
-
Facebook: How To Get Only Status Updates on Your FB Home Page
Ellen
for DATABASE in `cat /etc/db-backup/db-list.txt`with the following
for DATABASE in `echo 'show databases' | mysql`this is for user root with no password, if the user root has a password add '--password=' followed by your password INSTEAD of just putting '-p'
I've tried using '-p' but then I got the password prompt.
this is for user root with no password, if the user root has a password add '--password=' followed by your password INSTEAD of just putting '-p'
I've tried using '-p' but then I got the password prompt.
try using -ppassword
instead of -p password.
for DATABASE in `echo 'show databases' | mysql -p`--column-names=false should be added so that "Database", which is the column name, will not be included in the list.
Thus...
for DATABASE in `echo 'show databases' | mysql --column-names=false -p`<ul id="quote"><h6>Anonymous wrote:</h6>If you want to back up *every* database on the server, then replace this line
for DATABASE in `cat /etc/db-backup/db-list.txt`with the following
for DATABASE in `echo 'show databases' | mysql`</ul>
I am also looking for a reliable and dependable solution to backups my databases on the server and want to keep each backup for atleast 15-30 days.
I guess the solution mentioned here is more reliable than the ones available with php scripts.
Can you tell me the command to be executed on cron tab to take daily backups at a specified time?
Thanks.
Can you please tell me exact script with following parameters:
1. Type of hosting: shared
2. Objective: to backup every database and keep them for 15 days
3. Backup folder: /home/myid/db-backups
4. etc folder is located at /home/myid/etc
5. UserID: hello, password: iamok
Please also tell me the command to be executed on cron tab to run your sh script, thanks.
For our requirement, we were taking two level backups = Daily backups and Monthly backups. The daily backups are recycled every week and monthly backups are stored for much longer duration [As a matter of fact, we have not yet deleted them for past 3 years]. Of course, our backups are only 200+ MB now.
So we have ended up with:
01-2008.dmp, 02-2008.dmp, 03-2008.dmp, ... 05-2009, 06-2009.dmp, etc and seven daily dump files = Mon.dmp, Tue.dmp, Wed.dmp, ... Sat.dmp, Sun.dmp
We used `date +%e` to get the day of today. We used `date +%0m` to get month and `date +%0y` to get year.