<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title>Tech-Recipes - Latest Comments in MySQL &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://tech-recipes.disqus.com/</link><description>Cookbook of Tech Tutorials</description><atom:link href="https://tech-recipes.disqus.com/mysql_daily_database_dumps_all_nicely_sorted_mysql_tech_recipes/latest.rss" rel="self"></atom:link><language>en</language><lastBuildDate>Tue, 23 Jun 2009 08:13:05 -0000</lastBuildDate><item><title>Re: MySQL &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-11615502</link><description>&lt;p&gt;This looks great. I like the idea of gzipping it.&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;We used `date +%e` to get the day of today. We used `date +%0m` to get month and `date +%0y` to get year.&lt;/p&gt;</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 &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-6489328</link><description>&lt;p&gt;thanks very much for this explanation&lt;/p&gt;</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 &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767151</link><description>&lt;p&gt;I am little new to coding stuff and am bit confused to paths and user with or without password.&lt;/p&gt;&lt;p&gt;Can you please tell me exact script with following parameters:&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;Please also tell me the command to be executed on cron tab to run your sh script, thanks.&lt;/p&gt;</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 &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767150</link><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;I guess the solution mentioned here is more reliable than the ones available with php scripts.&lt;/p&gt;&lt;p&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.&lt;/p&gt;</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 &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767149</link><description>&lt;p&gt;Just on the code&lt;br&gt;&lt;code&gt;for DATABASE in `echo 'show databases' | mysql -p`&lt;/code&gt;&lt;/p&gt;&lt;p&gt;--column-names=false should be added so that "Database", which is the column name, will not be included in the list.&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;&lt;code&gt;for DATABASE in `cat /etc/db-backup/db-list.txt`&lt;/code&gt;&lt;/p&gt;&lt;p&gt;with the following&lt;/p&gt;&lt;p&gt;&lt;code&gt;for DATABASE in `echo 'show databases' | mysql`&lt;/code&gt;&lt;br&gt;&amp;lt;/ul&amp;gt;&lt;/p&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 &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767148</link><description>&lt;p&gt;&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;/p&gt;&lt;p&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;/p&gt;&lt;p&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.&lt;/p&gt;</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 &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767147</link><description>&lt;p&gt;&amp;lt;ul id="quote"&amp;gt;/usr/local/bin/mysqldump --user=root --opt $DATABASE | gzip &amp;lt;/ul&amp;gt;&lt;/p&gt;&lt;p&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;/p&gt;&lt;p&gt;I've tried using '-p' but then I got the password prompt.&lt;/p&gt;</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 &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767146</link><description>&lt;p&gt;If you want to back up *every* database on the server, then replace this line&lt;/p&gt;&lt;p&gt;&lt;code&gt;for DATABASE in `cat /etc/db-backup/db-list.txt`&lt;/code&gt;&lt;/p&gt;&lt;p&gt;with the following&lt;/p&gt;&lt;p&gt;&lt;code&gt;for DATABASE in `echo 'show databases' | mysql`&lt;/code&gt;&lt;/p&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 &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767145</link><description>&lt;p&gt;This is exactly what I've been looking for. Will try it soon.&lt;/p&gt;&lt;p&gt;Ellen&lt;/p&gt;</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 &amp;#8211; Daily database dumps, all nicely sorted.</title><link>http://www.tech-recipes.com/rx/221/mysql-daily-database-dumps-all-nicely-sorted/#comment-2767144</link><description>&lt;p&gt;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;&lt;/p&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>