<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: How to unzip my iTunes Library backup?</title>
	<link>http://ask.metafilter.com/99387/How-to-unzip-my-iTunes-Library-backup/</link>
	<description>Comments on Ask MetaFilter post How to unzip my iTunes Library backup?</description>
	<pubDate>Sun, 17 Aug 2008 11:02:22 -0800</pubDate>
	<lastBuildDate>Sun, 17 Aug 2008 11:02:22 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: How to unzip my iTunes Library backup?</title>
		<link>http://ask.metafilter.com/99387/How-to-unzip-my-iTunes-Library-backup</link>	
		<description>OS X filter:  How can I recursively unzip files (in directories that are not zipped)? &lt;br /&gt;&lt;br /&gt; One of my hard drives died, and took my iTunes Library with it (thanks, LaCie).  Luckily, I have a backup (made with SyncBack while I was still on WinXP).  I had zip-compression enabled in my backups, on a file-by-file basis.  So what I&apos;m left with is an iTunes library of uncompressed folders that contains individual mp3 files that are compressed (.zip, not .gzip).  And, yeah, I know, compressing files that are already compressed is stupid, but it seemed like a good idea at the time.  &lt;br&gt;
&lt;br&gt;
I&apos;m on OS X now, and I want to uncompress all of these and then drop them into iTunes.  &quot;gunzip -r *&quot; doesn&apos;t work because they&apos;re in .zip (rather than .gzip).  &quot;unzip -r *&quot; doesn&apos;t work because the directories are not also zipped. &lt;br&gt;
&lt;br&gt;
Can anyone help me with a little shell script magic to traverse these directories and unzip everything?  Or is there some other unzip utility out there that can handle this easily?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2008:site.99387</guid>
		<pubDate>Sun, 17 Aug 2008 10:43:12 -0800</pubDate>
		<dc:creator>wheat</dc:creator>
		
			<category>osx</category>
		
			<category>zip</category>
		
			<category>compression</category>
		
			<category>gzip</category>
		
			<category>macintosh</category>
		
	</item> <item>
		<title>By: philomathoholic</title>
		<link>http://ask.metafilter.com/99387/How-to-unzip-my-iTunes-Library-backup#1446235</link>	
		<description>find music_dir -type f -name *.zip -execdir unzip -r {} \;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.99387-1446235</guid>
		<pubDate>Sun, 17 Aug 2008 11:02:22 -0800</pubDate>
		<dc:creator>philomathoholic</dc:creator>
	</item><item>
		<title>By: Skorgu</title>
		<link>http://ask.metafilter.com/99387/How-to-unzip-my-iTunes-Library-backup#1446236</link>	
		<description>Something like: &lt;pre&gt;for n in find -name &quot;*.zip&quot;; do echo unzip $n; done&lt;/pre&gt; will probably work, this will probably drop the uncompressed files into your current working directory (not where the .zip is). If you want them in-place you&apos;d have to add something like &lt;pre&gt;for n in find -name &quot;*.zip&quot;; do (cd `basename $n`; pwd; echo unzip $n) done&lt;/pre&gt;&lt;br&gt;
&lt;br&gt;
I haven&apos;t tested these, but I&apos;ve used similar formulas in the past. They&apos;ll print the commands they would execute, remove the &apos;echo&apos;  if that looks right.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.99387-1446236</guid>
		<pubDate>Sun, 17 Aug 2008 11:04:24 -0800</pubDate>
		<dc:creator>Skorgu</dc:creator>
	</item><item>
		<title>By: fogster</title>
		<link>http://ask.metafilter.com/99387/How-to-unzip-my-iTunes-Library-backup#1446297</link>	
		<description>Yup, Skorgu&apos;s advice is what I&apos;ve used in the past. (And philomathoholic&apos;s looks good, too, just with different syntax.)&lt;br&gt;
&lt;br&gt;
A brief explanation, though &lt;tt&gt;man for&lt;/tt&gt; will tell you more than you ever want to know... The &apos;for&apos; will loop over the results of &lt;tt&gt;find -name &quot;*.zip&quot;&lt;/tt&gt;, setting &lt;tt&gt;n&lt;/tt&gt; (which you access as &lt;tt&gt;$n&lt;/tt&gt;) equal to the name of one file on each iteration, and for that, it will &quot;do&quot; &lt;tt&gt;echo unzip $n&lt;/tt&gt;: the &lt;tt&gt;$n&lt;/tt&gt; is expanded to the filename, recall. (The &quot;echo,&quot; as Skorgu explains, means that it&apos;ll just print the command it would run, so that you can verify it&apos;s doing what you want and then remove the &apos;echo&apos;.)&lt;br&gt;
&lt;br&gt;
One bit of advice, though: in theory, you could be super-slick and make the script run something like &lt;tt&gt;unzip $n &amp;amp;&amp;amp; rm $n&lt;/tt&gt; to unzip the .zip file and then delete it. And it sounds like it&apos;s great advice. But &lt;i&gt;don&apos;t do that&lt;/i&gt;. Our old pal Murphy intervenes, at least whenever I try doing something like this. Something, somewhere, will go wrong, and the unzip won&apos;t work right. And you&apos;ll have to run the command again. But you can&apos;t, because you have no more zip files, because you deleted them all &quot;to be slick&quot; and do it all in one fell swoop.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.99387-1446297</guid>
		<pubDate>Sun, 17 Aug 2008 12:24:03 -0800</pubDate>
		<dc:creator>fogster</dc:creator>
	</item><item>
		<title>By: philomathoholic</title>
		<link>http://ask.metafilter.com/99387/How-to-unzip-my-iTunes-Library-backup#1446320</link>	
		<description>To be nitpicky (in case of .zip files in the current dir) you should quote my *.zip, and skorgu&apos;s &lt;code&gt;$n&lt;/code&gt;&apos;s and &lt;code&gt;basename&lt;/code&gt;s (in case of spaces in the name). When I do a basename call with an unknown name, I use &lt;code&gt;&quot;$(basename -- &quot;$n&quot;)&quot;&lt;/code&gt; (note the double quoting used, both inside and outside).&lt;br&gt;
&lt;br&gt;
A bit of backup-related advice. What format are your songs in? aac? mp3? If they aren&apos;t in aiff or another uncompressed form (wav), then the zip compression doesn&apos;t really do much for the size of the file. Plus, it&apos;s possible to get a file that&apos;s larger when &quot;compressed&quot;, versus uncompressed.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.99387-1446320</guid>
		<pubDate>Sun, 17 Aug 2008 13:15:42 -0800</pubDate>
		<dc:creator>philomathoholic</dc:creator>
	</item><item>
		<title>By: philomathoholic</title>
		<link>http://ask.metafilter.com/99387/How-to-unzip-my-iTunes-Library-backup#1446322</link>	
		<description>&lt;small&gt;To nitpick my nitpick, I missed the part where you already knew about compressing compressed files. Sorry about that.&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.99387-1446322</guid>
		<pubDate>Sun, 17 Aug 2008 13:18:00 -0800</pubDate>
		<dc:creator>philomathoholic</dc:creator>
	</item><item>
		<title>By: wheat</title>
		<link>http://ask.metafilter.com/99387/How-to-unzip-my-iTunes-Library-backup#1446963</link>	
		<description>Thanks to everyone for the great advice, especially to fogster for walking through the code examples so I can understand them.  I&apos;ll try one of these methods out and report back.  &lt;br&gt;
&lt;br&gt;
philomathoholic:  yeah, they&apos;re almost all in .mp3 with some .aac.  I was just lazy with my SyncBack setup.  Zipping my other files saved a lot of space on my backup drive, but I needed to exclude this directory.  I&apos;m pretty sure there is a way to do that, but I didn&apos;t investigate it.  So, lesson learned there.  I have Time Machine rolling now, so this shouldn&apos;t be an issue in the future.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2008:site.99387-1446963</guid>
		<pubDate>Mon, 18 Aug 2008 07:28:31 -0800</pubDate>
		<dc:creator>wheat</dc:creator>
	</item>
	</channel>
</rss>
