<?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"
	>

<channel>
	<title>AdmiNirvana</title>
	<atom:link href="http://www.briandowney.net/blog/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.briandowney.net/blog</link>
	<description>Technical musings of an entrepreneur.</description>
	<pubDate>Mon, 22 Sep 2008 14:17:17 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>The Chronophage</title>
		<link>http://www.briandowney.net/blog/2008/09/22/the-chronophage/</link>
		<comments>http://www.briandowney.net/blog/2008/09/22/the-chronophage/#comments</comments>
		<pubDate>Mon, 22 Sep 2008 14:15:51 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[Cool]]></category>

		<category><![CDATA[Geeky]]></category>

		<category><![CDATA[Other Stuff]]></category>

		<category><![CDATA[chronophage]]></category>

		<category><![CDATA[clock]]></category>

		<category><![CDATA[corpus]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=113</guid>
		<description><![CDATA[Yet another cool-geeky thing.   Sort of wraps LoTR in with steampunk to bring you the wickedest clock I&#8217;ve ever seen:

Not only is the mechanical execution of the clock spectacular, but the thought behind it is equally awesome/creepy:
Your life is being eaten away by time, second by second, and represented by the Chronophage eating away, [...]]]></description>
			<content:encoded><![CDATA[<p>Yet another cool-geeky thing.   Sort of wraps LoTR in with steampunk to bring you the wickedest clock I&#8217;ve ever seen:</p>
<p style="text-align: center;"><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/pHO1JTNPPOU&#038;hl=en&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/pHO1JTNPPOU&#038;hl=en&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
<p>Not only is the mechanical execution of the clock spectacular, but the thought behind it is equally awesome/creepy:</p>
<p>Your life is being eaten away by time, second by second, and represented by the Chronophage eating away, bit by bit.   Oh yea, when it strikes the hour it sounds like chains falling into a coffin.</p>
<p>I want one.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/09/22/the-chronophage/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rubik&#8217;s Cube Robot</title>
		<link>http://www.briandowney.net/blog/2008/07/21/rubiks-cube-robot/</link>
		<comments>http://www.briandowney.net/blog/2008/07/21/rubiks-cube-robot/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 23:25:32 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[Funny]]></category>

		<category><![CDATA[Geeky]]></category>

		<category><![CDATA[lego]]></category>

		<category><![CDATA[mindstorm]]></category>

		<category><![CDATA[rubik's cube]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=112</guid>
		<description><![CDATA[Every once in a while I run across something, that even in my advanced state of uber-geekness, puts me in a state of awe.
Behold, the lego-robot that solves the Rubik&#8217;s Cube.
]]></description>
			<content:encoded><![CDATA[<p>Every once in a while I run across something, that even in my advanced state of uber-geekness, puts me in a state of awe.</p>
<p>Behold, the <a title="Tited Twister" href="http://tiltedtwister.com/index.html">lego-robot that solves the Rubik&#8217;s Cube</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/07/21/rubiks-cube-robot/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Rediggulo.us</title>
		<link>http://www.briandowney.net/blog/2008/07/02/rediggulous/</link>
		<comments>http://www.briandowney.net/blog/2008/07/02/rediggulous/#comments</comments>
		<pubDate>Wed, 02 Jul 2008 16:44:28 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[The Interweb]]></category>

		<category><![CDATA[aggregators]]></category>

		<category><![CDATA[reddiggulous]]></category>

		<category><![CDATA[social networking]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=111</guid>
		<description><![CDATA[Darn.  One of my favorite news-social-networking-aggregator sites (that&#8217;s my meme for it) has closed its doors.  The landing page for http://rediggulo.us now reads:
&#8220;It was fun while it lasted but we&#8217;re done.
Unfortunately, the experiment that was reddiggulo.us has come to an end.
Why end it?  We&#8217;re moving on to greener pastures.
Anyways, thanks for coming and clicking an [...]]]></description>
			<content:encoded><![CDATA[<p>Darn.  One of my favorite news-social-networking-aggregator sites (that&#8217;s my meme for it) has closed its doors.  The landing page for <a href="http://rediggulo.us">http://rediggulo.us</a> now reads:</p>
<h1><em>&#8220;It was fun while it lasted but we&#8217;re done.</em></h1>
<h3><em>Unfortunately, the experiment that was reddiggulo.us has come to an end.</em></h3>
<p><em>Why end it?  We&#8217;re moving on to greener pastures.</em></p>
<p><em>Anyways, thanks for coming and clicking an ad once in awhile.</em></p>
<p><em>Anyone interested in buying this domain, the code, database, etc, please contact &#8220;info&#8221; at this domain.&#8221;</em></p>
<p>Anyone game for snagging the domain and property?  I think I&#8217;ve got somewhere to host it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/07/02/rediggulous/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Time Machine via AFP</title>
		<link>http://www.briandowney.net/blog/2008/07/01/time-machine-via-afp/</link>
		<comments>http://www.briandowney.net/blog/2008/07/01/time-machine-via-afp/#comments</comments>
		<pubDate>Tue, 01 Jul 2008 20:55:47 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[Computers]]></category>

		<category><![CDATA[Miscellaneous]]></category>

		<category><![CDATA[Networking]]></category>

		<category><![CDATA[Storage]]></category>

		<category><![CDATA[apple]]></category>

		<category><![CDATA[backup]]></category>

		<category><![CDATA[mac]]></category>

		<category><![CDATA[network share]]></category>

		<category><![CDATA[time machine]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=109</guid>
		<description><![CDATA[I have been itching to get Time Machine to work over a (unsupported) network-shared volume since we&#8217;re unwilling to drop the cash for a Time Capsule.  I&#8217;ve seen quite a few different posts on how to get it done, including the terminal trick to tell Time Machine to use unsupported volumes, but none of them [...]]]></description>
			<content:encoded><![CDATA[<p>I have been itching to get Time Machine to work over a (unsupported) network-shared volume since we&#8217;re unwilling to drop the cash for a Time Capsule.  I&#8217;ve seen quite a few different posts on how to get it done, including the terminal trick to tell Time Machine to use unsupported volumes, but none of them quite worked.</p>
<p>The best I could get was Time Machine to begin to write the files to the share, but after a few seconds die with a vague &#8220;Backup disk could not be created error&#8221;.  This stumped me for a bit until I came <a title="TimeMachine via AFP" href="http://pastebin.com/f47499d34">across this</a>.  Apparently sometime around 10.5.2, Apple introduced a new, undocumented &#8220;feature&#8221; to Time Machine that causes it to fail over network volumes when doing the initial backup.   However, once the files are created it will work fine.</p>
<p>So, the magical combination is as follows:</p>
<ul>
<li>CentOS 5 with <a title="Netatalk" href="http://netatalk.sourceforge.net/">Netatalk-2.0.3</a> compiled, installed, and configured per <a title="Netatalk on CentOS 5" href="http://www.sharedknowhow.com/2008/05/installing-netatalk-under-centos-5-with-leopard-support/">this post</a>.  Note: I also had to modify etc/cnid_dbd/dbif.c with the same code change as specified there, but YMMV.</li>
<li>OS X Leopard, patched to 10.5.4.</li>
<li>Changes to Netatalk&#8217;s netatalk.conf file per <a title="Gentoo Wiki" href="http://gentoo-wiki.com/HOWTO_Share_Directories_via_AFP">this post</a> at the Gentoo Wiki.</li>
<li>Following the <a href="http://pastebin.com/f47499d34">post linked above</a> <strong>precisely</strong>.</li>
</ul>
<p>Once that happened, Time Machine has begun to work great over AFP to our backup volume&#8211;even for multiple Macs connecting to the same share. Behold!</p>
<p><a href="http://www.briandowney.net/blog/wp-content/uploads/2008/07/timemachine.jpg"><img class="aligncenter size-medium wp-image-110" title="timemachine" src="http://www.briandowney.net/blog/wp-content/uploads/2008/07/timemachine-300x199.jpg" alt="Time Machine working over a Net Share" width="300" height="199" /></a></p>
<p>It probably doesn&#8217;t need saying; but this is clearly an unsupported way to use Time Machine.  It has been running this way for me only about a day.    If you&#8217;re concerned about having to troubleshoot problems that may pop up down the road, especially regarding backups; picking up a <a href="http://www.apple.com/timecapsule/">Time Capsule</a> is probably a far better idea.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/07/01/time-machine-via-afp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fires still raging</title>
		<link>http://www.briandowney.net/blog/2008/06/27/fires-still-raging/</link>
		<comments>http://www.briandowney.net/blog/2008/06/27/fires-still-raging/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 19:28:23 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[Weather]]></category>

		<category><![CDATA[california]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=108</guid>
		<description><![CDATA[It has been almost a week, and the situation out / up here has gotten slowly, and progressively worse.   Most of the fire seems to be focused on the west side of town now, and the smoke has cleared out of the valley for the most part, giving us a view of what is going [...]]]></description>
			<content:encoded><![CDATA[<p>It has been almost a week, and the situation out / up here has gotten slowly, and progressively worse.   Most of the fire seems to be focused on the west side of town now, and the smoke has cleared out of the valley for the most part, giving us a view of what is going on up in the higher elevations.</p>
<p><img class="aligncenter" src="http://redding.mycapture.com/PHOTOS/REDD/1UserPhotos/287801E.jpg" alt="Mushroom Cloud" /></p>
<p>That is pretty much what we have been seeing.   It&#8217;s pretty scary how close a few are getting to town, but in general Redding is not nearly densely forested as the surrounding mountains.  So nothing to worry about, yet.</p>
<p>Some good news is that the majority of fires on the east side have been contained or extinguished altogether.</p>
<p>More thunderstorms are in the forcast for the weekend.  Great.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/06/27/fires-still-raging/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Fire, fire, everwhere!</title>
		<link>http://www.briandowney.net/blog/2008/06/23/fire-fire-everwhere/</link>
		<comments>http://www.briandowney.net/blog/2008/06/23/fire-fire-everwhere/#comments</comments>
		<pubDate>Mon, 23 Jun 2008 13:37:42 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[Weather]]></category>

		<category><![CDATA[california]]></category>

		<category><![CDATA[fire]]></category>

		<category><![CDATA[lightning]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=106</guid>
		<description><![CDATA[This past Saturday morning I went up to Benton to take one of my last lessons and instead watched a nasty lighting storm roll through.    Mix lightning and dry terrian, and you can imagine what happens next.
We have about 50 or so major fires going on in the highlands around us, and all the smoke [...]]]></description>
			<content:encoded><![CDATA[<p>This past Saturday morning I went up to Benton to take one of my last lessons and instead watched a nasty lighting storm roll through.    Mix lightning and dry terrian, and you can imagine what happens next.</p>
<p>We have about 50 or so major fires going on in the highlands around us, and all the smoke is settling down into the valley around Redding.   It smells like BBQ outside and the Sun has turned an eerie red-orange color; you can stare at it without even squinting.</p>
<p>One of the Mt. Lassen fires is a few miles away from my parents place in Shingletown.</p>
<p><a href="http://www.briandowney.net/blog/wp-content/uploads/2008/06/img_0657.jpg"><img class="aligncenter size-medium wp-image-107" title="sun_smoky" src="http://www.briandowney.net/blog/wp-content/uploads/2008/06/img_0657-300x225.jpg" alt="Smoky Sun" width="300" height="225" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/06/23/fire-fire-everwhere/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Phaedrah flew!</title>
		<link>http://www.briandowney.net/blog/2008/05/29/phaedrah-flew/</link>
		<comments>http://www.briandowney.net/blog/2008/05/29/phaedrah-flew/#comments</comments>
		<pubDate>Thu, 29 May 2008 23:57:10 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[Flying]]></category>

		<category><![CDATA[172]]></category>

		<category><![CDATA[cessna]]></category>

		<category><![CDATA[solo]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=103</guid>
		<description><![CDATA[Today Tex and I took Phaedrah up for a ride in 5519J.  Though she liked the ride, it got a little bumpy at the end&#8211;and she ended up getting a little motion sickness. All in all she had a good time, which is what counts!
Do we possibly have another pilot-in-training in the family?  [...]]]></description>
			<content:encoded><![CDATA[<p>Today Tex and I took Phaedrah up for a ride in 5519J.  Though she liked the ride, it got a little bumpy at the end&#8211;and she ended up getting a little motion sickness. All in all she had a good time, which is what counts!</p>
<p>Do we possibly have another pilot-in-training in the family?  Only time will tell!</p>
<p style="text-align: center;">
<a href='http://www.briandowney.net/blog/2008/05/29/phaedrah-flew/img_0332/' title='Taxiing around'><img src="http://www.briandowney.net/blog/wp-content/uploads/2008/05/img_0332-150x150.jpg" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
<a href='http://www.briandowney.net/blog/2008/05/29/phaedrah-flew/img_0363/' title='Phaedrah in 5519J'><img src="http://www.briandowney.net/blog/wp-content/uploads/2008/05/img_0363-150x150.jpg" width="150" height="150" class="attachment-thumbnail" alt="" /></a>
</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/05/29/phaedrah-flew/feed/</wfw:commentRss>
		</item>
		<item>
		<title>First solo flight!</title>
		<link>http://www.briandowney.net/blog/2008/05/16/first-solo-flight/</link>
		<comments>http://www.briandowney.net/blog/2008/05/16/first-solo-flight/#comments</comments>
		<pubDate>Fri, 16 May 2008 18:59:47 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[Flying]]></category>

		<category><![CDATA[cessna]]></category>

		<category><![CDATA[flight]]></category>

		<category><![CDATA[instruction]]></category>

		<category><![CDATA[solo]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=102</guid>
		<description><![CDATA[What great day!  We started out by doing some usual pattern work at Benton, a total of three landings.   After the third, my coach asked me to taxi up to the building&#8217;s garage, and then he proceeded to get out of the plane.
Next he said: &#8220;Now it&#8217;s your turn, do three more [...]]]></description>
			<content:encoded><![CDATA[<p>What great day!  We started out by doing some usual pattern work at Benton, a total of three landings.   After the third, my coach asked me to taxi up to the building&#8217;s garage, and then he proceeded to get out of the plane.</p>
<p>Next he said: &#8220;Now it&#8217;s your turn, do three more of the same.  Have fun!&#8221;</p>
<p>I did three more trips around the pattern on my own.  Coach stayed on the radio, just in case I needed him&#8211;but it was smooth flying.  After three decent (but not great) landings and doing it all on my own, I came back in and parked it.    He took a polaroid of me next to N5519J, filled out a Solo Certificate (for framing) and then wrote stuff all over my shirt and cut it out <img src='http://www.briandowney.net/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Tomorrow I had more time scheduled with my coach, but the plan has changed&#8211;it&#8217;s now all to myself.  I&#8217;m planning on taking her south over our practice area and just doing some basic S-turn stuff and circling our house a few times (turns about a point)!  Taking it easy at first and just having fun.  I can&#8217;t wait!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/05/16/first-solo-flight/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Flying solo&#8230; soon!</title>
		<link>http://www.briandowney.net/blog/2008/05/15/flying-solo-soon/</link>
		<comments>http://www.briandowney.net/blog/2008/05/15/flying-solo-soon/#comments</comments>
		<pubDate>Thu, 15 May 2008 21:26:50 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[Flying]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=101</guid>
		<description><![CDATA[After heading down to Disneyland last week, I got back on the horse and went up with my flight coach this morning. After having a week off, a bit of &#8220;skills rust&#8221; formed&#8211;mainly just flying the plane on final before landing. Nothing major; I just needed a few gentle reminders to cross-check things.
Overall today&#8217;s lesson was [...]]]></description>
			<content:encoded><![CDATA[<p>After heading down to Disneyland last week, I got back on the horse and went up with my flight coach this morning. After having a week off, a bit of &#8220;skills rust&#8221; formed&#8211;mainly just flying the plane on final before landing. Nothing major; I just needed a few gentle reminders to cross-check things.</p>
<p>Overall today&#8217;s lesson was &#8220;in my hands&#8221; and in the words of my coach, he was &#8220;only along for the ride&#8221;.  We departed from Benton Airpark on runway 33, and made a left downwind departure South on towards Red Bluff&#8217;s big airstrip. At Benton, we had 29 knot head winds from the North, but fortunately straight down the runway. By the time we made it to Red Bluff , the Northerly wind had died down a little&#8211;but because of it I made a decent (but unintentional) short-field landing. I received a word of caution from the coach, and also another lesson learned today&#8211;keep the airspeed at 65 knots on final no matter what it takes (power, flaps, whatever!). Don&#8217;t get so stuck in routine that you forget the basics.</p>
<p>After doing a touch-and-go at Red Bluff, it was off to Redding Municipal for some controlled airspace (Tower) work. I called in to Redding Tower about seven miles to the south with this line:</p>
<p>&#8220;Redding tower, cessna five five one niner juliet. We&#8217;re seven miles South over the I-5 weigh station inbound for a touch-and-go and request a left crosswind departure with information Romeo.&#8221;</p>
<p>Which won me some accolades from the coach.   I have never really been radio shy, and apparently this is now really helping me out down the road when dealing with controlled airspace.</p>
<p>Fortunately for us, Muni was slow today and I was the only plane in the area. After the call Redding Tower cleared us for a landing on 34. Nasty thing was that we were back in some rough North wind: 29 knots according to Muni ATIS&#8211;and now at about a 15-degree crosswind from the East. I did my best to keep it lined up, but rolled a little too much to the right in my slip just before touchdown. Coach helped out at the last bit, and made for a hectic few second.  But overall not a bad touchdown&#8211;for a 30 knot crosswind!  As my coach said: Any landing you walk away from is a good one! Heh.</p>
<p>Leaving Muni airspace and heading back to Benton, my coach said he&#8217;d take over for the landing at home. The winds were just getting too strong and starting to lean in further from the Northeast. Sure enough, as I flew over midfield at Benton, the windsock was straight out and at about a 20-degree angle from the East.  My coach did some amazing flying work coming down and we made it home safe.</p>
<p>During the de-brief we discussed how my landings still need some practice, but nothing so bad as to keep me from Soloing. I did received another &#8220;good job&#8221; on my radio work and for that I received a &#8220;1&#8243; again today (on a scale from 1-5, 1 being best). According to my coach&#8211;my first solo could be any time now, so I need to come prepared and in a beat up old shirt(?) I guess there&#8217;s some rite of passage when a PiT (Pilot in Training) first solos at Benton!</p>
<p>I&#8217;m on for trips up Friday morning and Saturday morning. We&#8217;ll see how it goes!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/05/15/flying-solo-soon/feed/</wfw:commentRss>
		</item>
		<item>
		<title>BASH Pipeline Exit Codes</title>
		<link>http://www.briandowney.net/blog/2008/05/05/bash-pipeline-exit-codes/</link>
		<comments>http://www.briandowney.net/blog/2008/05/05/bash-pipeline-exit-codes/#comments</comments>
		<pubDate>Mon, 05 May 2008 14:49:52 +0000</pubDate>
		<dc:creator>Brian</dc:creator>
		
		<category><![CDATA[Computers]]></category>

		<category><![CDATA[Linux]]></category>

		<category><![CDATA[Scripting]]></category>

		<guid isPermaLink="false">http://www.briandowney.net/blog/?p=99</guid>
		<description><![CDATA[I think I&#8217;ve mentioned many times on this blog, but one of the most satisfying things regarding Linux and Unix are that you&#8217;re never done learning about it.  A never-ending lesson in operating systems! Well, chalk up another lightbulb moment for me this morning.
Imagine a script wherein a process needs to be checked for [...]]]></description>
			<content:encoded><![CDATA[<p>I think I&#8217;ve mentioned many times on this blog, but one of the most satisfying things regarding Linux and Unix are that you&#8217;re never done learning about it.  A never-ending lesson in operating systems! Well, chalk up another lightbulb moment for me this morning.</p>
<p>Imagine a script wherein a process needs to be checked for proper exit.   Let&#8217;s say &#8220;mysqldump&#8221;.   Typically I&#8217;d do something like this, for example:</p>
<p><code><br />
#!/bin/bash<br />
STATUS=1<br />
while [ ${STATUS} -ne 0 ]<br />
do<br />
mysqldump -uroot -psomepass &#8211;all-databases &gt; sql-backup.sql<br />
STATUS=${?}<br />
done<br />
</code></p>
<p><code>exit 0<br />
</code></p>
<p>That&#8217;ll work just fine&#8211;the special reserved variable ${?} contains the exit code of the last run command.  Mysqldump is kind enough to use non-zero ones on any kind of error, so if it doesn&#8217;t work in our script we&#8217;ll retry.</p>
<p>But for instance, let&#8217;s say our script looks like this:</p>
<p><code><br />
#!/bin/bash<br />
STATUS=1<br />
while [ ${STATUS} -ne 0 ]<br />
do<br />
mysqldump -uroot -psomepass &#8211;all-databases | gzip  &gt; sql-backup.sql<br />
STATUS=${?}<br />
done<br />
</code></p>
<p><code>exit 0<br />
</code></p>
<p>The problem here is that ${?} now contains the exit code for gzip, not mysqldump!   Will gzip respond properly if mysqldump doesn&#8217;t provide an input stream from the pipe?  Maybe, maybe not.  Bottom line is that it isn&#8217;t reliable, and not what I&#8217;d consider good shell programming.</p>
<p>Instead, check out this solution:</p>
<p><code><br />
#!/bin/bash</code></p>
<p><code><br />
STATUS=1<br />
while [ ${STATUS} -ne 0 ]<br />
do<br />
mysqldump -uroot -psomepass &#8211;all-databases | gzip &gt; sql-backup.sql<br />
STATUS=${PIPESTATUS[0]}<br />
done<br />
</code></p>
<p><code> exit 0<br />
</code></p>
<p>The BASH reserved array ${PIPESTAUTUS[x]} contains the exit codes for all programs in the array. In this example, ${PIPESTATUS[0]} is mysqldump, and ${PIPESTATUS[1]} is gzip.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.briandowney.net/blog/2008/05/05/bash-pipeline-exit-codes/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
