<?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>Random notes &#38; other stuff... &#187; nc</title>
	<atom:link href="http://leucos.lstilde.org/wp/tag/nc/feed/" rel="self" type="application/rss+xml" />
	<link>http://leucos.lstilde.org/wp</link>
	<description>...about Linux, electronics, digital photography, whatever...</description>
	<lastBuildDate>Wed, 16 Dec 2009 00:29:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>File copy snippets</title>
		<link>http://leucos.lstilde.org/wp/2008/09/file-copy-snippets/</link>
		<comments>http://leucos.lstilde.org/wp/2008/09/file-copy-snippets/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 15:12:04 +0000</pubDate>
		<dc:creator>leucos</dc:creator>
				<category><![CDATA[sysadmin]]></category>
		<category><![CDATA[copy]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[nc]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tar]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://leucos.lstilde.org/wp/?p=17</guid>
		<description><![CDATA[Different command line file copy snippets that can save your ass.]]></description>
			<content:encoded><![CDATA[<p>Useful file copy snippets collection for systems administration.  scp is not here : syntax is trivial, and scp is <em>really</em> slow. The snippets below are supposed to be much faster, especially when dealing with many small files.</p>
<p><strong>netcat style</strong></p>
<ul>
<li>On sender :</li>
</ul>
<p>cd to the top dir to be copied recursively, and :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar cv . | nc -vq 10 -l -p 1234</div></div>
<ul>
<li>On receiver :</li>
</ul>
<p>cd to the dir where the content has to be copied, and :</p>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">nc -v sender 1234 | tar xf -</div></div>
<p><strong>ssh style</strong></p>
<ul>
<li>Data is remote, copy to where I am now :</li>
</ul>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ssh user@source &quot;cd /source/dir; tar cv .&quot; | tar x</div></div>
<ul>
<li>Data is in current directory, copy to remote server :</li>
</ul>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">tar cv . | ssh user@destination &quot;cd /dest/dir; tar x&quot;</div></div>
<p><strong>rsync+ssh style</strong></p>
<ul>
<li>Data is in current directory, copy to remote server :</li>
</ul>
<div class="codecolorer-container text default" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">rsync -ve ssh -ar . user@destination:/dest/dir/</div></div>
<p><em>Note : add &#8216;z&#8217; to tar options if link is slow</em></p>
]]></content:encoded>
			<wfw:commentRss>http://leucos.lstilde.org/wp/2008/09/file-copy-snippets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
