<?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>The WebZappr &#187; tar</title>
	<atom:link href="http://blog.webzappr.com/tag/tar/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.webzappr.com</link>
	<description>The Random Web Snippets of a Web Zapper</description>
	<lastBuildDate>Wed, 21 Jul 2010 00:14:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Network backup with netcat (nc) and tar</title>
		<link>http://blog.webzappr.com/2009/10/network-backup-with-netcat-nc-and-tar/</link>
		<comments>http://blog.webzappr.com/2009/10/network-backup-with-netcat-nc-and-tar/#comments</comments>
		<pubDate>Sat, 03 Oct 2009 15:37:48 +0000</pubDate>
		<dc:creator>Thorsten</dc:creator>
				<category><![CDATA[linux]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[nc]]></category>
		<category><![CDATA[netcat]]></category>
		<category><![CDATA[tar]]></category>

		<guid isPermaLink="false">http://blog.webzappr.com/?p=13855</guid>
		<description><![CDATA[Sometimes I need to recover some data from a server via network and either don&#8217;t have enough space on the source server I want to backup or just want to get things copied to an other server really quickly.
In this cases I usually just use the abilities of tar and netcat to create a backup [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I need to recover some data from a server via network and either don&#8217;t have enough space on the source server I want to backup or just want to get things copied to an other server really quickly.</p>
<p>In this cases I usually just use the abilities of <a href="http://www.gnu.org/software/tar/">tar</a> and <a href="http://en.wikipedia.org/wiki/Netcat">netcat</a> to create a backup via the network. </p>
<p>Let&#8217;s assume we have two computers:</p>
<p>- Computer A) which will be backed up.<br />
- Computer B), which ip addess is our REMOTE_IP and the backup  will be stored in this computer.</p>
<p>To create a backup we login to Computer B and launch netcat in listening mode using the following command.</p>
<pre class="brush: bash;">nc -l -p 6969 &gt;/root/backup.tgz</pre>
<p>This command tells netcat to start listening on port 6969 (you can use other free ports) and sends whatever it receives to /root/backup.tgz.</p>
<p>Once done the following command, executed on computer A will start the backup:</p>
<pre class="brush: bash;">sudo tar cvzp --same-owner --exclude=/root/backup.log --exclude=/proc/* --exclude=/media/* --exclude=/dev/* --exclude=/mnt/* --exclude=/sys/* --exclude=/tmp/* / 2&gt;/root/backup.log | nc -w 3 REMOTE_IP 6969</pre>
<p>This will create a full backup of your computer and excludes various system files which usually should not be copied. It also creates a logfile in /root/backup.log. </p>
<p><em>NOTES</em>
<ul>
<li>make sure to replace REMOTE_IP with the ip address of computer B and that the port number 6969 matches the one on computer B.</li>
<li>sometimes you might not have netcat available as &#8220;nc&#8221; and you need to type &#8220;netcat&#8221; instead.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.webzappr.com/2009/10/network-backup-with-netcat-nc-and-tar/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
