<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"><channel><title>Tech-Recipes - Latest Comments in MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><language>en</language><lastBuildDate>Tue, 23 Jun 2009 08:13:05 -0000</lastBuildDate><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-11615502</link><description>This looks great. I like the idea of gzipping it.&lt;br&gt;&lt;br&gt;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. &lt;br&gt;&lt;br&gt;So we have ended up with: &lt;br&gt;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 &lt;br&gt;&lt;br&gt;We used `date +%e` to get the day of today. We used `date +%0m` to get month and `date +%0y` to get year.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">N GowriSankar</dc:creator><pubDate>Tue, 23 Jun 2009 08:13:05 -0000</pubDate></item><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-6489328</link><description>thanks very much for this explanation</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">christian</dc:creator><pubDate>Sun, 22 Feb 2009 21:08:09 -0000</pubDate></item><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767151</link><description>I am little new to coding stuff and am bit confused to paths and user with or without password.&lt;br&gt;&lt;br&gt;Can you please tell me exact script with following parameters:&lt;br&gt;&lt;br&gt;1. Type of hosting: shared&lt;br&gt;2. Objective: to backup every database and keep them for 15 days&lt;br&gt;3. Backup folder: /home/myid/db-backups&lt;br&gt;4. etc folder is located at /home/myid/etc&lt;br&gt;5. UserID: hello, password: iamok&lt;br&gt;&lt;br&gt;Please also tell me the command to be executed on cron tab to run your sh script, thanks.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Sun, 13 Apr 2008 08:04:21 -0000</pubDate></item><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767150</link><description>Hi,&lt;br&gt;&lt;br&gt;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.&lt;br&gt;&lt;br&gt;I guess the solution mentioned here is more reliable than the ones available with php scripts.&lt;br&gt;&lt;br&gt;&lt;strong&gt;Can you tell me the command to be executed on cron tab to take daily backups at a specified time?&lt;br&gt;&lt;/strong&gt;&lt;br&gt;Thanks.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Sun, 13 Apr 2008 07:46:07 -0000</pubDate></item><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767149</link><description>Just on the code&lt;br&gt;&lt;code&gt;for DATABASE in `echo 'show databases' | mysql -p`&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;--column-names=false should be added so that "Database", which is the column name, will not be included in the list.&lt;br&gt;&lt;br&gt;Thus...&lt;br&gt;&lt;code&gt;for DATABASE in `echo 'show databases' | mysql --column-names=false -p`&lt;/code&gt;&lt;br&gt;&amp;lt;ul id="quote"&amp;gt;&amp;lt;h6&amp;gt;Anonymous wrote:&amp;lt;/h6&amp;gt;If you want to back up *every* database on the server, then replace this line&lt;br&gt;&lt;br&gt;&lt;code&gt;for DATABASE in `cat /etc/db-backup/db-list.txt`&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;with the following&lt;br&gt;&lt;br&gt;&lt;code&gt;for DATABASE in `echo 'show databases' | mysql`&lt;/code&gt;&lt;br&gt;&amp;lt;/ul&amp;gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Esquire</dc:creator><pubDate>Fri, 17 Jun 2005 15:36:10 -0000</pubDate></item><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767148</link><description>&amp;lt;ul id="quote"&amp;gt;&amp;lt;h6&amp;gt;Anonymous wrote:&amp;lt;/h6&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;ul id="quote"&amp;gt;/usr/local/bin/mysqldump --user=root --opt $DATABASE | gzip &amp;lt;/ul&amp;gt;&lt;br&gt;&lt;br&gt;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'&lt;br&gt;&lt;br&gt;I've tried using '-p' but then I got the password prompt.&lt;br&gt;try using -ppassword&lt;br&gt;instead of -p password.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Sun, 04 Jul 2004 04:05:16 -0000</pubDate></item><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767147</link><description>&amp;lt;ul id="quote"&amp;gt;/usr/local/bin/mysqldump --user=root --opt $DATABASE | gzip &amp;lt;/ul&amp;gt;&lt;br&gt;&lt;br&gt;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'&lt;br&gt;&lt;br&gt;I've tried using '-p' but then I got the password prompt.</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Thu, 01 Jul 2004 21:23:26 -0000</pubDate></item><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767146</link><description>If you want to back up *every* database on the server, then replace this line&lt;br&gt;&lt;br&gt;&lt;code&gt;for DATABASE in `cat /etc/db-backup/db-list.txt`&lt;/code&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;with the following&lt;br&gt;&lt;br&gt;&lt;code&gt;for DATABASE in `echo 'show databases' | mysql`&lt;/code&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Wed, 14 Apr 2004 07:20:32 -0000</pubDate></item><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767145</link><description>This is exactly what I've been looking for. Will try it soon.&lt;br&gt;&lt;br&gt;Ellen</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Sun, 30 Nov 2003 12:05:33 -0000</pubDate></item><item><title>Re: MySQL - Daily database dumps, all nicely sorted. | MySQL | Tech-Recipes</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767144</link><description>I know that replying to oneself is bad karma... but I noticed a typo above.  The backup files will be located under &lt;strong&gt;/home/backups/mysql/dbname-YYYY-MM-DD.tar.gz&lt;/strong&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">bofh468</dc:creator><pubDate>Tue, 11 Nov 2003 09:02:59 -0000</pubDate></item></channel></rss>