<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Ivan Villareal</title>
	<atom:link href="http://blog.ivanvillareal.info/tag/restore/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ivanvillareal.info</link>
	<description>IT stuff and more...</description>
	<lastBuildDate>Fri, 13 Aug 2010 23:05:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Compressing/Decompressing mysql dumps on the fly</title>
		<link>http://blog.ivanvillareal.info/linux/compressingdecompressing-mysql-dumps-on-the-fly/</link>
		<comments>http://blog.ivanvillareal.info/linux/compressingdecompressing-mysql-dumps-on-the-fly/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 20:17:06 +0000</pubDate>
		<dc:creator>Ivan Villareal</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[command line]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[pipes]]></category>
		<category><![CDATA[restore]]></category>

		<guid isPermaLink="false">http://blog.ivanvillareal.info/?p=197</guid>
		<description><![CDATA[One line commands I use to compress or decompress mysql dumps.]]></description>
			<content:encoded><![CDATA[<p>Using pipes and redirection in the shell we can do backups or restore them, performing compression or decompression on the fly, this are the commands I frequently use:</p>
<p>Create a backup <dbname>with mysqldump and compress the stream with bzip2<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">ivan<span style="color: #000000; font-weight: bold;">@</span>mini:~$ mysqldump –h dbHost –u dbUser –pdbPass –add-drop-database –databases <span style="color: #000000; font-weight: bold;">&lt;</span>dbname<span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">bzip2</span> <span style="color: #000000; font-weight: bold;">&gt;</span> dbName-02-<span style="color: #000000;">17</span>-2010.sql.bz2<span style="color: #000000; font-weight: bold;">&lt;/</span>dbname<span style="color: #000000; font-weight: bold;">&gt;</span></div></pre><!--END_DEVFMTCODE--></dbname></p>
<p>If I want to restore the backup I use:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title="Bash"><div class="devcodeoverflow">ivan<span style="color: #000000; font-weight: bold;">@</span>mini:~$ <span style="color: #c20cb9; font-weight: bold;">bunzip2</span> <span style="color: #000000; font-weight: bold;">&lt;</span> dbName-02-17-2010.sql.bz2 <span style="color: #000000; font-weight: bold;">|</span> mysql –h dbHost –u dbUser –pdbPass</div></pre><!--END_DEVFMTCODE--></p>
<p>I can switch bzip2 compression by changing only the program name for example gzip/gunzip lzma/unlzma</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ivanvillareal.info/linux/compressingdecompressing-mysql-dumps-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- www.000webhost.com Analytics Code -->
<script type="text/javascript" src="http://analytics.hosting24.com/count.php"></script>
<noscript><a href="http://www.hosting24.com/"><img src="http://analytics.hosting24.com/count.php" alt="web hosting" /></a></noscript>
<!-- End Of Analytics Code -->
