<?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: Copying files - duplicate filnames</title>
	<link>http://ask.metafilter.com/71179/Copying-files-duplicate-filnames/</link>
	<description>Comments on Ask MetaFilter post Copying files - duplicate filnames</description>
	<pubDate>Mon, 10 Sep 2007 05:40:00 -0800</pubDate>
	<lastBuildDate>Mon, 10 Sep 2007 05:40:00 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Copying files - duplicate filnames</title>
		<link>http://ask.metafilter.com/71179/Copying-files-duplicate-filnames</link>	
		<description>I want to copy files, ignoring &amp;amp; logging it if the target directory contains files with the same name. (Ubuntu 7.04) &lt;br /&gt;&lt;br /&gt; I have a large number of CD-Rs &amp;amp; DVD-Rs containing files (mostly mp3s, but I don&apos;t think that&apos;s particularly relevant to the problem at hand) organised which I would like to copy to my hard disk, on a Ubuntu 7.04 system.&lt;br&gt;
&lt;br&gt;
For each disc, I want to issue a single command (via command line or GUI, it doesn&apos;t matter) and have all the files recursively copied to the hard disk, retaining the directory structure. If a file with the same name already exists in the same directory in the target filesystem I would like it to be skipped and for this to be logged. I don&apos;t want the copying process to be interrupted with overwrite/ignore-type messages.&lt;br&gt;
&lt;br&gt;
Ideally, the identical filename situation would *not* be logged if the files were also identical in size (or even better, if they had the same hash). Also in a perfect world, the log would contain not only the names of skipped files, but also their size.&lt;br&gt;
&lt;br&gt;
The --update argument to cp automates the &apos;identical filename&apos; issue, but it is concerned with whether one file is more recent than another and that is not important to me.&lt;br&gt;
&lt;br&gt;
I&apos;ve looked at &lt;a href=&quot;http://www.cis.upenn.edu/~bcpierce/unison/&quot;&gt;Unison File Synchronizer&lt;/a&gt;, but can&apos;t see a way to get it to do what I want.&lt;br&gt;
&lt;br&gt;
Thanks!</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2007:site.71179</guid>
		<pubDate>Mon, 10 Sep 2007 04:30:41 -0800</pubDate>
		<dc:creator>Busy Old Fool</dc:creator>
		
			<category>files</category>
		
			<category>copy</category>
		
			<category>synchronise</category>
		
			<category>synchronize</category>
		
			<category>ubuntu</category>
		
			<category>linux</category>
		
	</item> <item>
		<title>By: DarkForest</title>
		<link>http://ask.metafilter.com/71179/Copying-files-duplicate-filnames#1061010</link>	
		<description>you could probably write a bash script, using find, cmp and cp. I don&apos;t have time to write it right now, but you can probably do it.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71179-1061010</guid>
		<pubDate>Mon, 10 Sep 2007 05:40:00 -0800</pubDate>
		<dc:creator>DarkForest</dc:creator>
	</item><item>
		<title>By: geminus</title>
		<link>http://ask.metafilter.com/71179/Copying-files-duplicate-filnames#1061019</link>	
		<description>You need &lt;a href=&quot;http://samba.anu.edu.au/rsync/&quot;&gt;rsync&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
From the &lt;a href=&quot;http://samba.anu.edu.au/ftp/rsync/rsync.html&quot;&gt;man page&lt;/a&gt;, I think you&apos;ll find the following options useful.&lt;br&gt;
&lt;br&gt;
--ignore-existing       skip updating files that exist on receiver&lt;br&gt;
&lt;br&gt;
Also: &lt;br&gt;
-r, --recursive             recurse into directories&lt;br&gt;
-u, --update                skip files that are newer on the receiver&lt;br&gt;
     --inplace               update destination files in-place&lt;br&gt;
     --append                append data onto shorter files&lt;br&gt;
-i, --itemize-changes       output a change-summary for all updates</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71179-1061019</guid>
		<pubDate>Mon, 10 Sep 2007 05:59:49 -0800</pubDate>
		<dc:creator>geminus</dc:creator>
	</item><item>
		<title>By: polyglot</title>
		<link>http://ask.metafilter.com/71179/Copying-files-duplicate-filnames#1061037</link>	
		<description>as per geminus, rsync is where it&apos;s at.  Or &quot;Perl is your friend&quot; but that&apos;s a lot of work for a simple problem like this.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71179-1061037</guid>
		<pubDate>Mon, 10 Sep 2007 06:55:12 -0800</pubDate>
		<dc:creator>polyglot</dc:creator>
	</item><item>
		<title>By: jquinby</title>
		<link>http://ask.metafilter.com/71179/Copying-files-duplicate-filnames#1061417</link>	
		<description>3rding rsync. You might be able to bolt together something in a shell script with &apos;find&apos;, but rsync would be easier/cleaner.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71179-1061417</guid>
		<pubDate>Mon, 10 Sep 2007 12:10:50 -0800</pubDate>
		<dc:creator>jquinby</dc:creator>
	</item><item>
		<title>By: Busy Old Fool</title>
		<link>http://ask.metafilter.com/71179/Copying-files-duplicate-filnames#1062349</link>	
		<description>I&apos;m sitting on the fence until a fourth person suggests rsync...&lt;br&gt;
&lt;br&gt;
Actually, when I was researching previous answers, I did find reference to rysnc, but for some reason decided it couldn&apos;t do what I wanted. I&apos;ll go back and look in earnest. &lt;br&gt;
&lt;br&gt;
Thanks, all!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71179-1062349</guid>
		<pubDate>Tue, 11 Sep 2007 07:08:04 -0800</pubDate>
		<dc:creator>Busy Old Fool</dc:creator>
	</item><item>
		<title>By: DarkForest</title>
		<link>http://ask.metafilter.com/71179/Copying-files-duplicate-filnames#1062484</link>	
		<description>with a shell script, you could get exactly what you want, but it does sound like rsync gets you 99% of the way there, so I&apos;ll give you your fourth on that.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.71179-1062484</guid>
		<pubDate>Tue, 11 Sep 2007 08:49:49 -0800</pubDate>
		<dc:creator>DarkForest</dc:creator>
	</item>
	</channel>
</rss>
