<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Copy files and directories recursively with tar</title>
	<atom:link href="http://www.tech-recipes.com/rx/115/copy-files-and-directories-recursively-with-tar/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tech-recipes.com/rx/115/copy-files-and-directories-recursively-with-tar/</link>
	<description>Computer and technology tutorials and guides</description>
	<lastBuildDate>Sat, 21 Nov 2009 18:18:34 -0800</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mikel Stous</title>
		<link>http://www.tech-recipes.com/rx/115/copy-files-and-directories-recursively-with-tar/comment-page-1/#comment-10152</link>
		<dc:creator>Mikel Stous</dc:creator>
		<pubDate>Tue, 07 Apr 2009 19:17:51 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-10152</guid>
		<description>I&#039;ve usually seen it with B for reassembling short reads into full records (reading 4.2BSD pipes).  In other words, rightsize the blocks for the filesystem.&lt;br&gt;&lt;br&gt;tar cf - * &#124; ( cd /target; tar xfBp -)</description>
		<content:encoded><![CDATA[<p>I&#39;ve usually seen it with B for reassembling short reads into full records (reading 4.2BSD pipes).  In other words, rightsize the blocks for the filesystem.</p>
<p>tar cf &#8211; * | ( cd /target; tar xfBp -)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: x</title>
		<link>http://www.tech-recipes.com/rx/115/copy-files-and-directories-recursively-with-tar/comment-page-1/#comment-5577</link>
		<dc:creator>x</dc:creator>
		<pubDate>Thu, 27 Nov 2008 19:37:26 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-5577</guid>
		<description>Better is&lt;br&gt;tar cf - . &#124; tar -C /target -xpf -</description>
		<content:encoded><![CDATA[<p>Better is<br />tar cf &#8211; . | tar -C /target -xpf -</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.tech-recipes.com/rx/115/copy-files-and-directories-recursively-with-tar/comment-page-1/#comment-937</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 28 Oct 2004 10:54:04 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-937</guid>
		<description>&lt;ul id=&quot;quote&quot;&gt;&lt;h6&gt;Anonymous wrote:&lt;/h6&gt;Not always, no.

for instance I recently used this to do a full path copy of some contents on a bad cdrom. For whatever reason I needed the entire path. So I did a variation and put it into a script so I could use it later. It went like this:

#!/bin/bash
 
find $1 &#124; while read i;
do tar cfv - $i &#124; ( cd $2 ; tar xfpv - )
done

So I could do something like this on the command line:

fullpathcp /dvd/Examples ~/tmp/copy

probably not the best use of cpu resources, but I got plenty of cycles to spare.

Also you can do interesting things with variations of this.

Like if your on a ftp server and they have a ls.gz file. This lists the contents of the server so you can go like this:

ftp server blah
username:anonymous
anonymous login ok. Please give E-mail address
password:
&gt; get ls.gz &quot;&#124;gunzip - &#124;less&quot;
or
&gt; get ls.gz &quot;&#124;gunzip - &#124;grep p0rn&quot;

And that way you can scroll around up and down. Or untar a file and download it onto your system...
&gt; get big.fat.tar.gz &quot;&#124; (cd ~/tmp/ ; tar zxf -)&quot;

or at least something similar. 

Also you can use Netcat to transfer files similar to that and so on and so forth. It&#039;s but one peice in a puzzle you need to build bigger and better scripts.&lt;/ul&gt;</description>
		<content:encoded><![CDATA[<ul id="quote">
<h6>Anonymous wrote:</h6>
<p>Not always, no.</p>
<p>for instance I recently used this to do a full path copy of some contents on a bad cdrom. For whatever reason I needed the entire path. So I did a variation and put it into a script so I could use it later. It went like this:</p>
<p>#!/bin/bash</p>
<p>find $1 | while read i;<br />
do tar cfv &#8211; $i | ( cd $2 ; tar xfpv &#8211; )<br />
done</p>
<p>So I could do something like this on the command line:</p>
<p>fullpathcp /dvd/Examples ~/tmp/copy</p>
<p>probably not the best use of cpu resources, but I got plenty of cycles to spare.</p>
<p>Also you can do interesting things with variations of this.</p>
<p>Like if your on a ftp server and they have a ls.gz file. This lists the contents of the server so you can go like this:</p>
<p>ftp server blah<br />
username:anonymous<br />
anonymous login ok. Please give E-mail address<br />
password:<br />
&gt; get ls.gz &#8220;|gunzip &#8211; |less&#8221;<br />
or<br />
&gt; get ls.gz &#8220;|gunzip &#8211; |grep p0rn&#8221;</p>
<p>And that way you can scroll around up and down. Or untar a file and download it onto your system&#8230;<br />
&gt; get big.fat.tar.gz &#8220;| (cd ~/tmp/ ; tar zxf -)&#8221;</p>
<p>or at least something similar. </p>
<p>Also you can use Netcat to transfer files similar to that and so on and so forth. It&#8217;s but one peice in a puzzle you need to build bigger and better scripts.</ul>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.tech-recipes.com/rx/115/copy-files-and-directories-recursively-with-tar/comment-page-1/#comment-240</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Mon, 12 Jul 2004 04:21:18 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-240</guid>
		<description>Not always, no.

for instance I recently used this to do a full path copy of some contents on a bad cdrom. For whatever reason I needed the entire path. So I did a variation and put it into a script so I could use it later. It went like this:

#!/bin/bash
 
find $1 &#124; while read i;
do tar cfv - $i &#124; ( cd $2 ; tar xfpv - )
done

So I could do something like this on the command line:

fullpathcp /dvd/Examples ~/tmp/copy

probably not the best use of cpu resources, but I got plenty of cycles to spare.

Also you can do interesting things with variations of this.

Like if your on a ftp server and they have a ls.gz file. This lists the contents of the server so you can go like this:

ftp server blah
username:anonymous
anonymous login ok. Please give E-mail address
password:
&gt; get ls.gz &quot;&#124;gunzip - &#124;less&quot;
or
&gt; get ls.gz &quot;&#124;gunzip - &#124;grep p0rn&quot;

And that way you can scroll around up and down. Or untar a file and download it onto your system...
&gt; get big.fat.tar.gz &quot;&#124; (cd ~/tmp/ ; tar zxf -)&quot;

or at least something similar. 

Also you can use Netcat to transfer files similar to that and so on and so forth. It&#039;s but one peice in a puzzle you need to build bigger and better scripts.</description>
		<content:encoded><![CDATA[<p>Not always, no.</p>
<p>for instance I recently used this to do a full path copy of some contents on a bad cdrom. For whatever reason I needed the entire path. So I did a variation and put it into a script so I could use it later. It went like this:</p>
<p>#!/bin/bash</p>
<p>find $1 | while read i;<br />
do tar cfv &#8211; $i | ( cd $2 ; tar xfpv &#8211; )<br />
done</p>
<p>So I could do something like this on the command line:</p>
<p>fullpathcp /dvd/Examples ~/tmp/copy</p>
<p>probably not the best use of cpu resources, but I got plenty of cycles to spare.</p>
<p>Also you can do interesting things with variations of this.</p>
<p>Like if your on a ftp server and they have a ls.gz file. This lists the contents of the server so you can go like this:</p>
<p>ftp server blah<br />
username:anonymous<br />
anonymous login ok. Please give E-mail address<br />
password:<br />
&gt; get ls.gz &#8220;|gunzip &#8211; |less&#8221;<br />
or<br />
&gt; get ls.gz &#8220;|gunzip &#8211; |grep p0rn&#8221;</p>
<p>And that way you can scroll around up and down. Or untar a file and download it onto your system&#8230;<br />
&gt; get big.fat.tar.gz &#8220;| (cd ~/tmp/ ; tar zxf -)&#8221;</p>
<p>or at least something similar. </p>
<p>Also you can use Netcat to transfer files similar to that and so on and so forth. It&#8217;s but one peice in a puzzle you need to build bigger and better scripts.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymous</title>
		<link>http://www.tech-recipes.com/rx/115/copy-files-and-directories-recursively-with-tar/comment-page-1/#comment-223</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Fri, 25 Jun 2004 14:58:56 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-223</guid>
		<description>I take it cp -pR directory newplace doesn&#039;t do the job?</description>
		<content:encoded><![CDATA[<p>I take it cp -pR directory newplace doesn&#8217;t do the job?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: bgebbie</title>
		<link>http://www.tech-recipes.com/rx/115/copy-files-and-directories-recursively-with-tar/comment-page-1/#comment-197</link>
		<dc:creator>bgebbie</dc:creator>
		<pubDate>Tue, 01 Jun 2004 14:26:44 +0000</pubDate>
		<guid isPermaLink="false">guid-fix-me!#comment-197</guid>
		<description>Note that the &lt;strong&gt;*&lt;/strong&gt; will not copy any of the files prefixed with a &lt;strong&gt;.&lt;/strong&gt; in the root directory.  It is a little tricky to wild card these files because one does not want to include the &lt;strong&gt;.&lt;/strong&gt; and &lt;strong&gt;..&lt;/strong&gt; directories so usually one adds &lt;strong&gt;.??*&lt;/strong&gt; to pick up everything else except for 1 and 2 character filenames prefixed with the &lt;strong&gt;.&lt;/strong&gt; e.g. &lt;strong&gt;.a&lt;/strong&gt;, &lt;strong&gt;.bc&lt;/strong&gt;. To copy these as well, you will want to list them by doing an &lt;code&gt;ls -a&lt;/code&gt;
 in the root directory first and typing those explicitly.

In Summary, I would recommend this instead:

&lt;code&gt;tar cf - * .??* &#124; &#40; cd /target; tar xfp -&#41;&lt;/code&gt;


but first do:

&lt;code&gt;ls -a&lt;/code&gt;


and if you see anything starting with a &lt;strong&gt;.&lt;/strong&gt; (besides &lt;strong&gt;..&lt;/strong&gt;) that is not followed by more then two characters, add those as well e.g.

&lt;code&gt;tar cf - * .??* .a .z .bc &#124; &#40; cd /target; tar xfp -&#41;&lt;/code&gt;
</description>
		<content:encoded><![CDATA[<p>Note that the <strong>*</strong> will not copy any of the files prefixed with a <strong>.</strong> in the root directory.  It is a little tricky to wild card these files because one does not want to include the <strong>.</strong> and <strong>..</strong> directories so usually one adds <strong>.??*</strong> to pick up everything else except for 1 and 2 character filenames prefixed with the <strong>.</strong> e.g. <strong>.a</strong>, <strong>.bc</strong>. To copy these as well, you will want to list them by doing an <code>ls -a</code><br />
 in the root directory first and typing those explicitly.</p>
<p>In Summary, I would recommend this instead:</p>
<p><code>tar cf - * .??* | &#40; cd /target; tar xfp -&#41;</code></p>
<p>but first do:</p>
<p><code>ls -a</code></p>
<p>and if you see anything starting with a <strong>.</strong> (besides <strong>..</strong>) that is not followed by more then two characters, add those as well e.g.</p>
<p><code>tar cf - * .??* .a .z .bc | &#40; cd /target; tar xfp -&#41;</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
