<?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>Marius van Witzenburg &#187; FreeBSD</title>
	<atom:link href="http://kitara.nl/tag/freebsd/feed/" rel="self" type="application/rss+xml" />
	<link>http://kitara.nl</link>
	<description>We fight for our survival, we fight!</description>
	<lastBuildDate>Sun, 20 May 2012 15:39:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>How to easy CVS update your SRC and Ports tree with a simple Bash script (v2)</title>
		<link>http://kitara.nl/2011/09/26/how-to-easy-cvs-update-your-src-and-ports-tree-with-a-simple-bash-script-v2/</link>
		<comments>http://kitara.nl/2011/09/26/how-to-easy-cvs-update-your-src-and-ports-tree-with-a-simple-bash-script-v2/#comments</comments>
		<pubDate>Mon, 26 Sep 2011 20:29:22 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[CVS]]></category>
		<category><![CDATA[CVSup]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Ports]]></category>
		<category><![CDATA[Src]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=6473</guid>
		<description><![CDATA[This is an update to this post: How to easy CVS update your SRC and Ports tree with a simple Bash script I adjusted the script to use the local csup version of the FreeBSD World system and moved the cvsup files to /etc. First install a simple tool to get the fastest cvs server [...]]]></description>
			<content:encoded><![CDATA[<p>This is an update to this post: <a href="http://kitara.nl/2011/07/10/how-to-easy-cvs-update-your-src-and-ports-tree-with-a-simple-bash-script/" title="How to easy CVS update your SRC and Ports tree with a simple Bash script">How to easy CVS update your SRC and Ports tree with a simple Bash script</a></p>
<p>I adjusted the script to use the local csup version of the FreeBSD World system and moved the cvsup files to /etc.</p>
<p>First install a simple tool to get the fastest cvs server</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">pkg_add -r fastest_cvsup</pre></div></div>

<p>Or from Ports (if you have the collection already):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cd /usr/ports/sysutils/fastest_cvsup/
make install clean</pre></div></div>

<p>Setup config and binary to easy update the repository for SRC and PORTS.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mkdir /etc/cvsup
cd /usr/share/examples/cvsup
cp stable-supfile /etc/cvsup
cp ports-supfile /etc/cvsup
cp doc-supfile /etc/cvsup
cd /etc/cvsup</pre></div></div>

<p>Edit <strong>stable-supfile</strong> and change:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">*default release=cvs tag=RELENG_8_2</pre></div></div>

<p>Set this to your release version.</p>
<p>Edit <strong>/usr/local/sbin/runcvsup</strong> and add:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">arg</span>=$<span style="color: #000000; font-weight: bold;">@</span>
<span style="color: #007800;">sType</span>=<span style="color: #ff0000;">&quot;tld,nl&quot;</span> <span style="color: #666666; font-style: italic;"># Can be: all / tld / tld,nl,de,fr,us</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #007800;">SERVER</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>fastest_cvsup <span style="color: #660033;">-q</span> <span style="color: #660033;">-c</span> <span style="color: #007800;">$sType</span><span style="color: #000000; font-weight: bold;">`</span>; <span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Using server: <span style="color: #007800;">${SERVER}</span>&quot;</span>
    <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$arg</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
    <span style="color: #ff0000;">&quot;stable&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating: stable&quot;</span>
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>csup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>stable-supfile
    <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #ff0000;">&quot;ports&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating: ports&quot;</span>
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>csup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>ports-supfile
    <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #ff0000;">&quot;doc&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>  
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating: doc&quot;</span>
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>csup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>doc-supfile
    <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating: all&quot;</span>
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>csup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>stable-supfile
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>csup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>ports-supfile
        <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>csup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>doc-supfile
    <span style="color: #000000; font-weight: bold;">;;</span>
    <span style="color: #000000; font-weight: bold;">esac</span>    
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>Set the right permissions:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">chmod 700 /usr/local/sbin/runcvsup</pre></div></div>

<p>Update everything:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">runcvsup</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/09/26/how-to-easy-cvs-update-your-src-and-ports-tree-with-a-simple-bash-script-v2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to update your FreeBSD kernel and World system</title>
		<link>http://kitara.nl/2011/07/10/how-to-update-your-freebsd-kernel-and-world-system/</link>
		<comments>http://kitara.nl/2011/07/10/how-to-update-your-freebsd-kernel-and-world-system/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 15:34:27 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[Mergemaster]]></category>
		<category><![CDATA[Update]]></category>
		<category><![CDATA[World]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=117</guid>
		<description><![CDATA[Auto install using freebsd-update See: How to use freebsd-update to update your FreeBSD kernel and world system Manual Update World / Kernel Its advised to run this in Screen, you can install it from /usr/ports/sysutils/screen. First you have to update the SRC and Ports tree, follow the manual on this page to complete this step. [...]]]></description>
			<content:encoded><![CDATA[<h2>Auto install using freebsd-update</h2>
<p>See: <a href="http://kitara.nl/2011/07/10/how-to-use-freebsd-update-to-update-your-freebsd-kernel-and-world-system/" title="How to use freebsd-update to update your FreeBSD kernel and world system">How to use freebsd-update to update your FreeBSD kernel and world system</a></p>
<h2>Manual Update World / Kernel</h2>
<p>Its advised to run this in Screen, you can install it from <strong>/usr/ports/sysutils/screen</strong>.</p>
<p>First you have to update the SRC and Ports tree, follow the manual on <a href="http://kitara.nl/2011/07/10/how-to-easy-cvs-update-your-src-and-ports-tree-with-a-simple-bash-script/" title="How to easy CVS update your SRC and Ports tree with a simple Bash script">this page</a> to complete this step.</p>
<p>Next is to configure the make.conf so it won't install things we don't want.<br />
Be sure you check out <strong>man make.conf</strong> for some make optimalisation settings.</p>
<p>Here is an example that I use:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">WITHOUT_X11=yes
NO_GAMES=yes
NO_X=yes
&nbsp;
# make optimalization (-j4, 4 = optimal for 1 cpu)
MAKEOPTS=&quot;-j4 -B&quot;</pre></div></div>

<p>In case you have edited (which is a 100% chance you did) files of the world installation you might need to edit the <strong>mergemaster.rc</strong> file and add some settings before running <strong>mergemaster</strong>.</p>
<p>Check this page to view an example: <a href="http://kitara.nl/2011/07/10/how-to-configure-mergemaster-to-merge-configurations-on-freebsd/" title="How to configure mergemaster to merge configurations on FreeBSD">How to configure mergemaster to merge configurations on FreeBSD</a>.</p>
<p>These are the steps to install a fresh kernel and world system. The <strong>TMPDIR</strong> that I use is because I disabled the ability to execute files on the standard /tmp mount.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mkdir /tmp_world
setenv TMPDIR /tmp_world
cd /usr/src
make clean
make buildworld
make buildkernel
make installkernel
make installworld</pre></div></div>

<p>Merge the world system:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mergemaster</pre></div></div>

<p>Be sure you check out <strong>man mergemaster</strong>. For example people use the <strong>-p</strong> argument. This can be handy in some situations.</p>
<p>Remove temp dir:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">unsetenv TMPDIR
rm -r /tmp_world</pre></div></div>

<p><strong>Short versions</strong> (might be unsafe):</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;"># Kernel &amp; World</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>tmp_world ; setenv TMPDIR <span style="color: #000000; font-weight: bold;">/</span>tmp_world; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src; <span style="color: #c20cb9; font-weight: bold;">make</span> clean
<span style="color: #c20cb9; font-weight: bold;">make</span> buildworld <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> buildkernel <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> installkernel <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #c20cb9; font-weight: bold;">make</span> installworld
mergemaster
unsetenv TMPDIR; <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>tmp_world
&nbsp;
<span style="color: #666666; font-style: italic;"># Kernel-only</span>
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>tmp_world ; setenv TMPDIR <span style="color: #000000; font-weight: bold;">/</span>tmp_world; <span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>src; <span style="color: #c20cb9; font-weight: bold;">make</span> clean
<span style="color: #c20cb9; font-weight: bold;">make</span> buildkernel; <span style="color: #c20cb9; font-weight: bold;">make</span> installkernel
unsetenv TMPDIR; <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>tmp_world</pre></div></div>

<p><strong>Remove builded objects, only after a release upgrade:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cd /usr/obj
chflags -R noschg *
rm -rf *</pre></div></div>

<h2>Custom KERNEL</h2>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cd /usr/src/sys/i386/conf/
cp GENERIC YOURKERNEL
echo &quot;# Kernel configuration&quot; &gt;&gt; /etc/make.conf
echo &quot;KERNCONF=YOURKERNEL&quot; &gt;&gt; /etc/make.conf</pre></div></div>

<p>Compile the same as above, only leave out the <strong>buildworld</strong> and <strong>installworld</strong>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/07/10/how-to-update-your-freebsd-kernel-and-world-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to configure mergemaster to merge configurations on FreeBSD</title>
		<link>http://kitara.nl/2011/07/10/how-to-configure-mergemaster-to-merge-configurations-on-freebsd/</link>
		<comments>http://kitara.nl/2011/07/10/how-to-configure-mergemaster-to-merge-configurations-on-freebsd/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 10:37:32 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Config]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Ignore]]></category>
		<category><![CDATA[Mergemaster]]></category>
		<category><![CDATA[Ports]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=6203</guid>
		<description><![CDATA[Ignore files for upgrade, for example you could add /etc/motd here. Simply edit the file /etc/mergemaster.rc and add the following line: IGNORE_FILES='/etc/motd' Another example: # Automatically install files that do not exist on the system already AUTO_INSTALL=yes &#160; # Automatically upgrade files that have not been user modified AUTO_UPGRADE=yes &#160; # Preserve files that you [...]]]></description>
			<content:encoded><![CDATA[<p>Ignore files for upgrade, for example you could add <strong>/etc/motd</strong> here.</p>
<p>Simply edit the file <strong>/etc/mergemaster.rc</strong> and add the following line:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">IGNORE_FILES='/etc/motd'</pre></div></div>

<p>Another example:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Automatically install files that do not exist on the system already
AUTO_INSTALL=yes
&nbsp;
# Automatically upgrade files that have not been user modified
AUTO_UPGRADE=yes
&nbsp;
# Preserve files that you replace
PRESERVE_FILES=yes
PRESERVE_FILES_DIR=/var/tmp/mergemaster/preserved-files-`date +%y%m%d-%H%M%S`
&nbsp;
# Files to always avoid comparing (space separated)
IGNORE_FILES='/etc/motd /etc/rc.conf'</pre></div></div>

<p>For more information check out <a href="http://www.freebsd.org/cgi/man.cgi?query=mergemaster&#038;apropos=0&#038;sektion=0&#038;manpath=FreeBSD+7.1-RELEASE&#038;format=html">the manual page</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/07/10/how-to-configure-mergemaster-to-merge-configurations-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to easy CVS update your SRC and Ports tree with a simple Bash script</title>
		<link>http://kitara.nl/2011/07/10/how-to-easy-cvs-update-your-src-and-ports-tree-with-a-simple-bash-script/</link>
		<comments>http://kitara.nl/2011/07/10/how-to-easy-cvs-update-your-src-and-ports-tree-with-a-simple-bash-script/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 10:34:24 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[CVS]]></category>
		<category><![CDATA[CVSup]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Ports]]></category>
		<category><![CDATA[Src]]></category>
		<category><![CDATA[Upgrade]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=6195</guid>
		<description><![CDATA[Check this updated post: How to easy CVS update your SRC and Ports tree with a simple Bash script (v2) Its advised to run this in Screen, you can install it from /usr/ports/sysutils/screen. First install a simple tool to get the fastest cvs server pkg_add -r fastest_cvsup Or from Ports (if you have the collection [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Check this updated post:</strong> <a href="http://kitara.nl/2011/09/26/how-to-easy-cvs-update-your-src-and-ports-tree-with-a-simple-bash-script-v2/" title="How to easy CVS update your SRC and Ports tree with a simple Bash script (v2)">How to easy CVS update your SRC and Ports tree with a simple Bash script (v2)</a></p>
<p>Its advised to run this in Screen, you can install it from <strong>/usr/ports/sysutils/screen</strong>.</p>
<p>First install a simple tool to get the fastest cvs server</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">pkg_add -r fastest_cvsup</pre></div></div>

<p>Or from Ports (if you have the collection already):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cd /usr/ports/sysutils/fastest_cvsup/
make install clean</pre></div></div>

<p>Install CVSUP</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">pkg_add -r cvsup-without-gui</pre></div></div>

<p>Or from Ports (if you have the collection already):</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">cd /usr/ports/net/cvsup-without-gui
make install clean</pre></div></div>

<p>Setup config and binary to easy update the repository for SRC and PORTS.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mkdir /usr/local/etc/cvsup
cd /usr/share/examples/cvsup
cp stable-supfile /usr/local/etc/cvsup
cp ports-supfile /usr/local/etc/cvsup
cp doc-supfile /usr/local/etc/cvsup
cd /usr/local/etc/cvsup</pre></div></div>

<p>Edit <strong>stable-supfile</strong> and change:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">*default release=cvs tag=RELENG_7_1</pre></div></div>

<p>Set this to your release version.</p>
<p>Edit <strong>/usr/local/etc/cvsup/runcvsup</strong> and add:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #007800;">arg</span>=$<span style="color: #000000; font-weight: bold;">@</span>
<span style="color: #007800;">sType</span>=<span style="color: #ff0000;">&quot;tld,nl&quot;</span> <span style="color: #666666; font-style: italic;"># Can be: all / tld / tld,nl,de,fr,us</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #007800;">SERVER</span>=<span style="color: #000000; font-weight: bold;">`/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>fastest_cvsup <span style="color: #660033;">-q</span> <span style="color: #660033;">-c</span> <span style="color: #007800;">$sType</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Using server: <span style="color: #007800;">${SERVER}</span>&quot;</span>
        <span style="color: #000000; font-weight: bold;">case</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$arg</span>&quot;</span> <span style="color: #000000; font-weight: bold;">in</span>
        <span style="color: #ff0000;">&quot;stable&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating: stable&quot;</span>
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cvsup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>stable-supfile
        <span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #ff0000;">&quot;ports&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating: ports&quot;</span>
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cvsup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>ports-supfile
        <span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #ff0000;">&quot;doc&quot;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating: doc&quot;</span>
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cvsup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>doc-supfile
        <span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">*</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
                <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Updating: all&quot;</span>
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cvsup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>stable-supfile
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cvsup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>ports-supfile
                <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>cvsup <span style="color: #660033;">-L</span> <span style="color: #000000;">2</span> <span style="color: #660033;">-g</span> <span style="color: #660033;">-z</span> <span style="color: #660033;">-h</span> <span style="color: #800000;">${SERVER}</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>cvsup<span style="color: #000000; font-weight: bold;">/</span>doc-supfile
        <span style="color: #000000; font-weight: bold;">;;</span>
        <span style="color: #000000; font-weight: bold;">esac</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></div></div>

<p>Set the right permissions:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">chmod 700 runcvsup</pre></div></div>

<p>Link the script so it can be reached.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ln -s /usr/local/etc/cvsup/runcvsup /usr/local/bin/runcvsup
rehash</pre></div></div>

<p>Update everything:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">runcvsup</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/07/10/how-to-easy-cvs-update-your-src-and-ports-tree-with-a-simple-bash-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to use freebsd-update to update your FreeBSD kernel and world system</title>
		<link>http://kitara.nl/2011/07/10/how-to-use-freebsd-update-to-update-your-freebsd-kernel-and-world-system/</link>
		<comments>http://kitara.nl/2011/07/10/how-to-use-freebsd-update-to-update-your-freebsd-kernel-and-world-system/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 10:08:37 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Kernel]]></category>
		<category><![CDATA[System]]></category>
		<category><![CDATA[World]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=6185</guid>
		<description><![CDATA[Information http://www.freebsd.org/doc/en/books/handbook/updating-upgrading-freebsdupdate.html Keep in mind, if you have a custom kernel that you need to upgrade your kernel manually!!! Usage The freebsd-update(8) utility supports binary upgrades of i386 and amd64 systems running earlier FreeBSD releases. Systems running 7.[01234]-RELEASE, 8.[01]-RELEASE, 8.2-BETA1, or 8.2-RC[123] can upgrade as follows: # freebsd-update upgrade -r 8.2-RELEASE During this process, FreeBSD [...]]]></description>
			<content:encoded><![CDATA[<h2>Information</h2>
<p><a href="http://www.freebsd.org/doc/en/books/handbook/updating-upgrading-freebsdupdate.html">http://www.freebsd.org/doc/en/books/handbook/updating-upgrading-freebsdupdate.html</a></p>
<p><strong>Keep in mind, if you have a custom kernel that you need to upgrade your kernel manually!!!</strong></p>
<h2>Usage</h2>
<p>The freebsd-update(8) utility supports binary upgrades of i386 and amd64 systems running earlier FreeBSD releases. Systems running 7.[01234]-RELEASE, 8.[01]-RELEASE, 8.2-BETA1, or 8.2-RC[123] can upgrade as follows:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># freebsd-update upgrade -r 8.2-RELEASE</pre></div></div>

<p>During this process, FreeBSD Update may ask the user to help by merging some configuration files or by confirming that the automatically performed merging was done correctly.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># freebsd-update install</pre></div></div>

<p>The system must be rebooted with the newly installed kernel before continuing.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># shutdown -r now</pre></div></div>

<p>After rebooting, freebsd-update needs to be run again to install the new userland components:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># freebsd-update install</pre></div></div>

<p>At this point, users of systems being upgraded from FreeBSD 7.4-RELEASE or earlier will be prompted by freebsd-update to rebuild all third-party applications (e.g., ports installed from the ports tree) due to updates in system libraries.</p>
<p>After updating installed third-party applications (and again, only if freebsd-update printed a message indicating that this was necessary), run freebsd-update again so that it can delete the old (no longer used) system libraries:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># freebsd-update install</pre></div></div>

<p>Finally, reboot into 8.2-RELEASE:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># shutdown -r now</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/07/10/how-to-use-freebsd-update-to-update-your-freebsd-kernel-and-world-system/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to install and use portaudit on FreeBSD</title>
		<link>http://kitara.nl/2011/07/10/how-to-install-and-use-portaudit-on-freebsd/</link>
		<comments>http://kitara.nl/2011/07/10/how-to-install-and-use-portaudit-on-freebsd/#comments</comments>
		<pubDate>Sun, 10 Jul 2011 09:31:29 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[portaudit]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Vulnerability]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=6172</guid>
		<description><![CDATA[Installation Install portaudit from the ports collection. cd /usr/ports/ports-mgmt/portaudit make install clean Usage When you install or upgrade a port, portaudit will automatically check for vurnability problems. To disable the check while doing a //make install// add: DISABLE_VULNERABILITIES=1 Manual check: portaudit -Fda Portupgrade It might happen that you want to upgrade a port which has [...]]]></description>
			<content:encoded><![CDATA[<h2>Installation</h2>
<p>Install portaudit from the ports collection.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>ports-mgmt<span style="color: #000000; font-weight: bold;">/</span>portaudit
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></div></div>

<h2>Usage</h2>
<p>When you install or upgrade a port, portaudit will automatically check for vurnability problems.</p>
<p>To disable the check while doing a //make install// add:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">DISABLE_VULNERABILITIES=1</pre></div></div>

<p>Manual check:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portaudit <span style="color: #660033;">-Fda</span></pre></div></div>

<p><strong>Portupgrade</strong><br />
It might happen that you want to upgrade a port which has vulnerabilities. You need to pass on the make argument like this:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">portupgrade <span style="color: #660033;">-m</span> <span style="color: #007800;">DISABLE_VULNERABILITIES</span>=<span style="color: #000000;">1</span> <span style="color: #ff0000;">'php52*'</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/07/10/how-to-install-and-use-portaudit-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to configure Bind name server as caching LAN server on FreeBSD</title>
		<link>http://kitara.nl/2011/07/05/how-to-configure-bind-name-server-as-caching-lan-server-on-freebsd/</link>
		<comments>http://kitara.nl/2011/07/05/how-to-configure-bind-name-server-as-caching-lan-server-on-freebsd/#comments</comments>
		<pubDate>Tue, 05 Jul 2011 20:04:22 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Bind]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[LAN]]></category>
		<category><![CDATA[Named]]></category>
		<category><![CDATA[Server]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=5953</guid>
		<description><![CDATA[On FreeBSD 8.x and higher this manual should work fine. Bind is default installed. Edit /etc/namedb/named.conf and add/change the following. options {} block listen-on { 127.0.0.1; 192.168.1.2; }; forwarders { 8.8.8.8; 8.8.4.4; }; At the bottom of the file add your zones, example: zone &#34;kitara.nl&#34; { type master; file &#34;/etc/namedb/master/domain.tld-forward.db&#34;; }; Edit your master file [...]]]></description>
			<content:encoded><![CDATA[<p>On FreeBSD 8.x and higher this manual should work fine. Bind is default installed.</p>
<p>Edit <strong>/etc/namedb/named.conf</strong> and add/change the following.</p>
<p>options {} block</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">    listen-on {
        127.0.0.1;
        192.168.1.2;
    };
    forwarders {
        8.8.8.8;
        8.8.4.4;
    };</pre></div></div>

<p>At the bottom of the file add your zones, example:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">zone &quot;kitara.nl&quot; {
    type master;
    file &quot;/etc/namedb/master/domain.tld-forward.db&quot;;
};</pre></div></div>

<p>Edit your master file and add/edit this to your needs, open <strong>/etc/namedb/master/domain.tld-forward.db</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">$TTL 1h
kitara.nl. SOA kitara.nl. nobody.kitara.nl. 42 1d 12h 1w 3h
            ; Serial, Refresh, Retry, Expire, Neg. cache TTL
&nbsp;
            NS  ns.kitara.nl.
&nbsp;
            A   77.74.48.170
*           A   77.74.48.170
localhost   A   127.0.0.1
www         A   77.74.48.170
prn         A   172.16.32.12</pre></div></div>

<p>Now edit <strong>/etc/rc.conf</strong> and add the startup value.</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">named_enable=&quot;YES&quot;</pre></div></div>

<p>Now start named</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">/etc/rc.d/named start</pre></div></div>

<p>Now test your server by throwing in some queries:</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Short output
host google.com 127.0.0.1
# More output
dig @127.0.0.1 google.com</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/07/05/how-to-configure-bind-name-server-as-caching-lan-server-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to mount a Western Digital ShareSpace NFS share</title>
		<link>http://kitara.nl/2011/06/30/how-to-mount-a-western-digital-sharespace-nfs-share/</link>
		<comments>http://kitara.nl/2011/06/30/how-to-mount-a-western-digital-sharespace-nfs-share/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 18:42:59 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Mac OS X]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Mount]]></category>
		<category><![CDATA[NFS]]></category>
		<category><![CDATA[Sharespace]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=5558</guid>
		<description><![CDATA[This might become handy if you want to connect the drive on a FreeBSD or Linux machine to easy transfer files to it. Enable NFS on your Western Digital ShareSpace Log into your web interface and goto Advanced Mode Goto the tab Network Goto Services Here check the Enable checkbox and add the IP of [...]]]></description>
			<content:encoded><![CDATA[<p>This might become handy if you want to connect the drive on a FreeBSD or Linux machine to easy transfer files to it.</p>
<h2>Enable NFS on your Western Digital ShareSpace</h2>
<p><strong>Log into your web interface and goto Advanced Mode</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-1.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-1-512x335.png" alt="" title="WD ShareSpace enable NFS, 1" width="512" height="335" class="alignnone size-medium wp-image-5759" /></a></p>
<p><strong>Goto the tab Network</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-2.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-2-512x347.png" alt="" title="WD ShareSpace enable NFS, 2" width="512" height="347" class="alignnone size-medium wp-image-5760" /></a></p>
<p><strong>Goto Services</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-3.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-3-512x190.png" alt="" title="WD ShareSpace enable NFS, 3" width="512" height="190" class="alignnone size-medium wp-image-5761" /></a></p>
<p><strong>Here check the Enable checkbox and add the IP of the machine you want to grant access</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-4.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-4-512x487.png" alt="" title="WD ShareSpace enable NFS, 4" width="512" height="487" class="alignnone size-medium wp-image-5762" /></a></p>
<p><strong>Next goto Storage</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-5.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-5-512x346.png" alt="" title="WD ShareSpace enable NFS, 5" width="512" height="346" class="alignnone size-medium wp-image-5763" /></a></p>
<p><strong>Edit the share preferences</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-6.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-6-512x189.png" alt="" title="WD ShareSpace enable NFS, 6" width="512" height="189" class="alignnone size-medium wp-image-5764" /></a></p>
<p><strong>Enable NFS support for this share</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-7.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-7-512x180.png" alt="" title="WD ShareSpace enable NFS, 7" width="512" height="180" class="alignnone size-medium wp-image-5765" /></a></p>
<p><strong>Goto Users</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-8.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-8-512x246.png" alt="" title="WD ShareSpace enable NFS 8" width="512" height="246" class="alignnone size-medium wp-image-5817" /></a></p>
<p><strong>Edit the user preferences</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-9.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-9-512x233.png" alt="" title="WD ShareSpace enable NFS 9" width="512" height="233" class="alignnone size-medium wp-image-5818" /></a></p>
<p><strong>Grand optional write access to this user</strong><br />
<a href="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-10.png"><img src="http://kitara.nl/wp-content/uploads/2011/06/WD-ShareSpace-enable-NFS-10-512x222.png" alt="" title="WD ShareSpace enable NFS 10" width="512" height="222" class="alignnone size-medium wp-image-5819" /></a></p>
<h2>Connect to NFS mount of ShareSpace on FreeBSD</h2>
<p>List mounts</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">showmount -e 192.168.2.3</pre></div></div>

<p>Connect mountpoint</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;"># Read only
mount -t nfs 192.168.2.3:/DataVolume/backup /mnt/
# Read / Write
mount -t nfs -o rw 192.168.2.3:/DataVolume/backup /mnt/</pre></div></div>

<p>Add share to /etc/fstab</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">172.16.32.44:/DataVolume/backup /backup nfs rw  2   2</pre></div></div>

<p>Mount with <strong>mount -a</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/06/30/how-to-mount-a-western-digital-sharespace-nfs-share/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to backup to a Western Digital ShareSpace drive via SSH-only rsync from FreeBSD</title>
		<link>http://kitara.nl/2011/06/30/how-to-backup-to-a-western-digital-sharespace-drive-via-ssh-only-rsync-from-freebsd/</link>
		<comments>http://kitara.nl/2011/06/30/how-to-backup-to-a-western-digital-sharespace-drive-via-ssh-only-rsync-from-freebsd/#comments</comments>
		<pubDate>Thu, 30 Jun 2011 17:39:22 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[Backup]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[Rsync]]></category>
		<category><![CDATA[Sharespace]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[WD]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=5692</guid>
		<description><![CDATA[This manual helps you to backup directories from your server to a Western Digital ShareSpace. You might need this: How to enable SSH on a Western Digital ShareSpace Create directories and generate a key for the target mkdir /usr/data/backup mkdir /usr/data/backup/keys ssh-keygen -t rsa -f /usr/data/backup/keys/sharespace find /usr/data/backup -type f -exec chmod 600 &#34;{}&#34; \; [...]]]></description>
			<content:encoded><![CDATA[<p>This manual helps you to backup directories from your server to a Western Digital ShareSpace.</p>
<p>You might need this: <a href="http://kitara.nl/2011/06/30/how-to-enable-ssh-on-a-western-digital-sharespace/" title="How to enable SSH on a Western Digital ShareSpace" >How to enable SSH on a Western Digital ShareSpace</a></p>
<p><strong>Create directories and generate a key for the target</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">mkdir /usr/data/backup
mkdir /usr/data/backup/keys
ssh-keygen -t rsa -f /usr/data/backup/keys/sharespace
find /usr/data/backup -type f -exec chmod 600 &quot;{}&quot; \; 
find /usr/data/backup -type d -exec chmod 700 &quot;{}&quot; \;</pre></div></div>

<p><strong>Add public key to the ShareSpace root account</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ssh root@&lt;SharespaceIP&gt;
&nbsp;
cd /root
mkdir .ssh
chmod 700 .ssh
&nbsp;
# Add key to this file.
vi ssh/authorized_keys
&nbsp;
chmod 700 .ssh/authorized_keys</pre></div></div>

<p><strong>Add scripts to server</strong></p>
<p>Place <strong>backup.sh</strong> in <strong>/usr/backup/</strong> and <strong>functions.sh</strong> in <strong>/usr/backup/includes/</strong>. Then simply edit to your needs and run with <strong>./backup.sh</strong> or from Cron.</p>
<p><strong>backup.sh</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># Backup system</span>
<span style="color: #666666; font-style: italic;"># by Marius van Witzenburg &lt;marius@kitara.nl&gt;</span>
<span style="color: #666666; font-style: italic;"># http://kitara.nl</span>
&nbsp;
<span style="color: #007800;">mailto</span>=<span style="color: #ff0000;">&quot;marius@kitara.nl&quot;</span>
<span style="color: #007800;">mailfrom</span>=<span style="color: #ff0000;">&quot;noreply@kitara.nl&quot;</span>
&nbsp;
<span style="color: #007800;">root</span>=<span style="color: #ff0000;">&quot;/usr/data/backup&quot;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">###</span>
<span style="color: #666666; font-style: italic;"># Do not edit below!</span>
<span style="color: #666666; font-style: italic;">###</span>
<span style="color: #007800;">PATH</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>sbin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin:<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>sbin
<span style="color: #007800;">pid</span>=<span style="color: #007800;">$$</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">source</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>include<span style="color: #000000; font-weight: bold;">/</span>functions.sh
&nbsp;
<span style="color: #666666; font-style: italic;"># Create needed directories</span>
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>files <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>files
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>include <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>include
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>keys <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>keys
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>log <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>log
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>tmp <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>tmp
<span style="color: #7a0874; font-weight: bold;">test</span> <span style="color: #660033;">-d</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>server <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>server
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #007800;">$pid</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>backup.pid
&nbsp;
<span style="color: #666666; font-style: italic;"># Sync Public</span>
sync_public <span style="color: #ff0000;">&quot;192.168.1.50&quot;</span> <span style="color: #ff0000;">&quot;neo&quot;</span> <span style="color: #ff0000;">&quot;/usr/data/storage/public&quot;</span> <span style="color: #000000;">22</span>
sync_public <span style="color: #ff0000;">&quot;192.168.2.50&quot;</span> <span style="color: #ff0000;">&quot;trinity&quot;</span> <span style="color: #ff0000;">&quot;/usr/data/storage/public&quot;</span> <span style="color: #000000;">12345</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Sync files to ShareSpace drives</span>
sync_sharespace <span style="color: #ff0000;">&quot;192.168.1.50&quot;</span> <span style="color: #ff0000;">&quot;neo&quot;</span> <span style="color: #ff0000;">&quot;/usr/data/files&quot;</span> <span style="color: #ff0000;">&quot;files&quot;</span> <span style="color: #000000;">22</span>
sync_sharespace <span style="color: #ff0000;">&quot;192.168.1.50&quot;</span> <span style="color: #ff0000;">&quot;neo&quot;</span> <span style="color: #ff0000;">&quot;/usr/data/music&quot;</span> <span style="color: #ff0000;">&quot;music&quot;</span> <span style="color: #000000;">22</span>
sync_sharespace <span style="color: #ff0000;">&quot;192.168.1.50&quot;</span> <span style="color: #ff0000;">&quot;neo&quot;</span> <span style="color: #ff0000;">&quot;/usr/data/storage&quot;</span> <span style="color: #ff0000;">&quot;storage&quot;</span> <span style="color: #000000;">22</span>
sync_sharespace <span style="color: #ff0000;">&quot;192.168.2.50&quot;</span> <span style="color: #ff0000;">&quot;trinity&quot;</span> <span style="color: #ff0000;">&quot;/usr/data/files&quot;</span> <span style="color: #ff0000;">&quot;files&quot;</span> <span style="color: #000000;">12345</span>
sync_sharespace <span style="color: #ff0000;">&quot;192.168.2.50&quot;</span> <span style="color: #ff0000;">&quot;trinity&quot;</span> <span style="color: #ff0000;">&quot;/usr/data/music&quot;</span> <span style="color: #ff0000;">&quot;music&quot;</span> <span style="color: #000000;">12345</span>
sync_sharespace <span style="color: #ff0000;">&quot;192.168.2.50&quot;</span> <span style="color: #ff0000;">&quot;trinity&quot;</span> <span style="color: #ff0000;">&quot;/usr/data/storage&quot;</span> <span style="color: #ff0000;">&quot;storage&quot;</span> <span style="color: #000000;">12345</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

<p><strong>includes/functions.sh</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-z</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$root</span>&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;DO NOT CALL THIS FILE DIRECTLY!&quot;</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">date</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #ff0000;">&quot;+%d-%m-%Y&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">date_reverse</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> <span style="color: #ff0000;">&quot;+%Y-%m-%d&quot;</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">hostname</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">hostname</span> -s<span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">hostletters</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">hostname</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #c20cb9; font-weight: bold;">sed</span> <span style="color: #660033;">-E</span> <span style="color: #ff0000;">'s/([A-Za-z0-9])[^.]*\.?/\1/g'</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #007800;">sshport</span>=<span style="color: #000000;">22</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Usage: email &quot;subject&quot; &quot;message&quot;</span>
email<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">all</span>=$<span style="color: #000000; font-weight: bold;">@</span>  
    <span style="color: #007800;">subject</span>=<span style="color: #007800;">$1</span>
    <span style="color: #007800;">message</span>=<span style="color: #007800;">$2</span>
    <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;From: <span style="color: #007800;">$mailfrom</span><span style="color: #000099; font-weight: bold;">\n</span>To: <span style="color: #007800;">$mailto</span><span style="color: #000099; font-weight: bold;">\n</span>Subject: <span style="color: #007800;">$subject</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span><span style="color: #007800;">$message</span>&quot;</span> <span style="color: #000000; font-weight: bold;">|</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>sbin<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">sendmail</span> <span style="color: #660033;">-t</span> <span style="color: #007800;">$mailto</span> 
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Cleanup loggin and temp directories</span>
cleanup<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>
    <span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
stop_public<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">all</span>=$<span style="color: #000000; font-weight: bold;">@</span>  
    <span style="color: #007800;">signal</span>=<span style="color: #007800;">$1</span>
    <span style="color: #007800;">name</span>=<span style="color: #007800;">$2</span> 
    <span style="color: #007800;">ip</span>=<span style="color: #007800;">$3</span>   
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;finish&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>    
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> == <span style="color: #ff0000;">'int'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> == <span style="color: #ff0000;">'term'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
        <span style="color: #000000; font-weight: bold;">then</span>    
            cleanup 
        <span style="color: #000000; font-weight: bold;">fi</span>      
&nbsp;
        logger <span style="color: #660033;">-s</span> <span style="color: #660033;">-p</span> daemon.notice <span style="color: #660033;">-t</span> <span style="color: #ff0000;">'backup'</span> <span style="color: #ff0000;">&quot;stop_public(): Public Sync shutdown!. Target: <span style="color: #007800;">$name</span> (<span style="color: #007800;">$ip</span>), Signal: <span style="color: #007800;">$signal</span>&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #007800;">$JOB</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> == <span style="color: #ff0000;">'int'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> == <span style="color: #ff0000;">'term'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
        <span style="color: #000000; font-weight: bold;">then</span>    
            <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$?</span> 
        <span style="color: #000000; font-weight: bold;">else</span>    
            <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$?</span>
        <span style="color: #000000; font-weight: bold;">fi</span>      
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Syntax: sync_public &quot;srv_ip&quot; &quot;srv_name&quot; &quot;source&quot;</span>
sync_public<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">all</span>=$<span style="color: #000000; font-weight: bold;">@</span>  
    <span style="color: #007800;">srv_ip</span>=<span style="color: #007800;">$1</span>
    <span style="color: #007800;">srv_name</span>=<span style="color: #007800;">$2</span>
    <span style="color: #007800;">src</span>=<span style="color: #007800;">$3</span>  
    <span style="color: #007800;">sshport</span>=<span style="color: #007800;">$4</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Give it a rest so we don't flood the sshd!</span>
    <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">3</span> 
&nbsp;
    <span style="color: #007800;">key</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$root</span>/keys/<span style="color: #007800;">$srv_name</span>&quot;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">#trap &quot;stop_public hub $srv_name $srv_ip&quot; SIGHUP</span>
    <span style="color: #7a0874; font-weight: bold;">trap</span> <span style="color: #ff0000;">&quot;stop_public int <span style="color: #007800;">$srv_name</span> <span style="color: #007800;">$srv_ip</span>&quot;</span> SIGINT
    <span style="color: #7a0874; font-weight: bold;">trap</span> <span style="color: #ff0000;">&quot;stop_public term <span style="color: #007800;">$srv_name</span> <span style="color: #007800;">$srv_ip</span>&quot;</span> SIGTERM 
&nbsp;
    <span style="color: #007800;">alive</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-ax</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;BatchMode=yes&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;ConnectTimeout 15&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$key</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$sshport</span> root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #007800;">$srv_ip</span> <span style="color: #ff0000;">&quot;echo 0 2&gt;&amp;1&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$alive</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> 
    <span style="color: #000000; font-weight: bold;">then</span>    
        rsync <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;ssh -ax -i <span style="color: #007800;">$key</span> -p <span style="color: #007800;">$sshport</span>&quot;</span> <span style="color: #660033;">-aWvz</span> <span style="color: #660033;">--timeout</span>=<span style="color: #000000;">300</span> <span style="color: #660033;">--delete-during</span> <span style="color: #007800;">$src</span><span style="color: #000000; font-weight: bold;">/</span> root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #007800;">$srv_ip</span>:<span style="color: #000000; font-weight: bold;">/</span>shares<span style="color: #000000; font-weight: bold;">/</span>Public<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>run <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
        <span style="color: #007800;">JOB</span>=<span style="color: #007800;">$!</span>  
        <span style="color: #7a0874; font-weight: bold;">wait</span> <span style="color: #007800;">$JOB</span>
&nbsp;
        <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-2</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>run <span style="color: #000000; font-weight: bold;">|</span> logger <span style="color: #660033;">-p</span> daemon.info <span style="color: #660033;">-t</span> <span style="color: #ff0000;">'backup'</span>
&nbsp;
        stop_public finish <span style="color: #007800;">$srv_name</span> <span style="color: #007800;">$srv_ip</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        logger <span style="color: #660033;">-s</span> <span style="color: #660033;">-p</span> daemon.notice <span style="color: #660033;">-t</span> <span style="color: #ff0000;">'backup'</span> <span style="color: #ff0000;">&quot;sync_public(): Connection to <span style="color: #007800;">$srv_name</span> (<span style="color: #007800;">$srv_ip</span>) failed...&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>  
&nbsp;
stop_sharespace<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">all</span>=$<span style="color: #000000; font-weight: bold;">@</span>
    <span style="color: #007800;">signal</span>=<span style="color: #007800;">$1</span>
    <span style="color: #007800;">name</span>=<span style="color: #007800;">$2</span>
    <span style="color: #007800;">ip</span>=<span style="color: #007800;">$3</span>
    <span style="color: #007800;">key</span>=<span style="color: #007800;">$4</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> <span style="color: #000000; font-weight: bold;">!</span>= <span style="color: #ff0000;">&quot;finish&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> == <span style="color: #ff0000;">'int'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> == <span style="color: #ff0000;">'term'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
        <span style="color: #000000; font-weight: bold;">then</span>
            cleanup
        <span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
        logger <span style="color: #660033;">-s</span> <span style="color: #660033;">-p</span> daemon.notice <span style="color: #660033;">-t</span> <span style="color: #ff0000;">'backup'</span> <span style="color: #ff0000;">&quot;stop_sharespace(): ShareSpace backup shutdown!. Target: <span style="color: #007800;">$name</span> (<span style="color: #007800;">$ip</span>), Signal: <span style="color: #007800;">$signal</span>&quot;</span>
        <span style="color: #c20cb9; font-weight: bold;">kill</span> <span style="color: #007800;">$JOB</span>
&nbsp;
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> == <span style="color: #ff0000;">'int'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$signal</span>&quot;</span> == <span style="color: #ff0000;">'term'</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
        <span style="color: #000000; font-weight: bold;">then</span>
            <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #007800;">$?</span>
        <span style="color: #000000; font-weight: bold;">else</span>
            <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #007800;">$?</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>  
&nbsp;
sync_sharespace<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#123;</span>
    <span style="color: #007800;">all</span>=$<span style="color: #000000; font-weight: bold;">@</span>
    <span style="color: #007800;">srv_ip</span>=<span style="color: #007800;">$1</span>
    <span style="color: #007800;">srv_name</span>=<span style="color: #007800;">$2</span>
    <span style="color: #007800;">src</span>=<span style="color: #007800;">$3</span>
    <span style="color: #007800;">target</span>=<span style="color: #007800;">$4</span>
    <span style="color: #007800;">sshport</span>=<span style="color: #007800;">$5</span>
&nbsp;
    <span style="color: #666666; font-style: italic;"># Give it a rest so we don't flood the sshd!</span>
    <span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">3</span>
&nbsp;
    <span style="color: #007800;">key</span>=<span style="color: #ff0000;">&quot;<span style="color: #007800;">$root</span>/keys/<span style="color: #007800;">$srv_name</span>&quot;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">#trap &quot;stop_sharespace hub $srv_name $srv_ip $key&quot; SIGHUP</span>
    <span style="color: #7a0874; font-weight: bold;">trap</span> <span style="color: #ff0000;">&quot;stop_sharespace int <span style="color: #007800;">$srv_name</span> <span style="color: #007800;">$srv_ip</span> <span style="color: #007800;">$key</span>&quot;</span> SIGINT
    <span style="color: #7a0874; font-weight: bold;">trap</span> <span style="color: #ff0000;">&quot;stop_sharespace term <span style="color: #007800;">$srv_name</span> <span style="color: #007800;">$srv_ip</span> <span style="color: #007800;">$key</span>&quot;</span> SIGTERM
&nbsp;
    <span style="color: #007800;">alive</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-ax</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-q</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;BatchMode=yes&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;ConnectTimeout 15&quot;</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$key</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$sshport</span> root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #007800;">$srv_ip</span> <span style="color: #ff0000;">&quot;echo 0 2&gt;&amp;1&quot;</span> <span style="color: #000000; font-weight: bold;">&amp;&amp;</span> <span style="color: #7a0874; font-weight: bold;">return</span> <span style="color: #000000;">0</span> <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #000000;">1</span><span style="color: #000000; font-weight: bold;">`</span>
    <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$alive</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
    <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #666666; font-style: italic;"># Create required directory for server name</span>
        <span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #660033;">-ax</span> <span style="color: #660033;">-i</span> <span style="color: #007800;">$key</span> <span style="color: #660033;">-p</span> <span style="color: #007800;">$sshport</span> root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #007800;">$srv_ip</span> <span style="color: #ff0000;">&quot;test -d /shares/backup/<span style="color: #007800;">$hostname</span> || mkdir /shares/backup/<span style="color: #007800;">$hostname</span>&quot;</span>
        <span style="color: #007800;">JOB</span>=<span style="color: #007800;">$!</span>
        <span style="color: #7a0874; font-weight: bold;">wait</span> <span style="color: #007800;">$JOB</span>
&nbsp;
        <span style="color: #666666; font-style: italic;"># Sync data</span>
        logger <span style="color: #660033;">-p</span> daemon.notice <span style="color: #660033;">-t</span> <span style="color: #ff0000;">'backup'</span> <span style="color: #ff0000;">&quot;sync_sharespace(): Syncing '<span style="color: #007800;">$src</span>'...&quot;</span>
        rsync <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;ssh -ax -i <span style="color: #007800;">$key</span> -p <span style="color: #007800;">$sshport</span>&quot;</span> <span style="color: #660033;">-rtlDWvp</span> <span style="color: #660033;">--timeout</span>=<span style="color: #000000;">300</span> <span style="color: #660033;">--chmod</span>=<span style="color: #007800;">Dug</span>=rwX,<span style="color: #007800;">Fug</span>=rwX,<span style="color: #007800;">Do</span>=rX,<span style="color: #007800;">Fo</span>=r <span style="color: #660033;">--delete-during</span> <span style="color: #007800;">$src</span><span style="color: #000000; font-weight: bold;">/</span> root<span style="color: #000000; font-weight: bold;">@</span><span style="color: #007800;">$srv_ip</span>:<span style="color: #000000; font-weight: bold;">/</span>shares<span style="color: #000000; font-weight: bold;">/</span>backup<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$hostname</span><span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$target</span><span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>run <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;&amp;</span><span style="color: #000000;">1</span> <span style="color: #000000; font-weight: bold;">&amp;</span>
        <span style="color: #007800;">JOB</span>=<span style="color: #007800;">$!</span>
        <span style="color: #7a0874; font-weight: bold;">wait</span> <span style="color: #007800;">$JOB</span>
&nbsp;
        <span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #660033;">-2</span> <span style="color: #007800;">$root</span><span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>run <span style="color: #000000; font-weight: bold;">|</span> logger <span style="color: #660033;">-p</span> daemon.info <span style="color: #660033;">-t</span> <span style="color: #ff0000;">'backup'</span>
&nbsp;
        stop_sharespace finish <span style="color: #007800;">$srv_name</span> <span style="color: #007800;">$srv_ip</span> <span style="color: #007800;">$key</span>
    <span style="color: #000000; font-weight: bold;">else</span>
        logger <span style="color: #660033;">-s</span> <span style="color: #660033;">-p</span> daemon.notice <span style="color: #660033;">-t</span> <span style="color: #ff0000;">'backup'</span> <span style="color: #ff0000;">&quot;sync_sharespace(): Connection to <span style="color: #007800;">$srv_name</span> (<span style="color: #007800;">$srv_ip</span>) failed...&quot;</span>
    <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># EOF</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/06/30/how-to-backup-to-a-western-digital-sharespace-drive-via-ssh-only-rsync-from-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to configure a automatically native IPv6 connection on FreeBSD</title>
		<link>http://kitara.nl/2011/06/26/how-to-configure-a-automatically-native-ipv6-connection-on-freebsd/</link>
		<comments>http://kitara.nl/2011/06/26/how-to-configure-a-automatically-native-ipv6-connection-on-freebsd/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 17:20:37 +0000</pubDate>
		<dc:creator>mariusvw</dc:creator>
				<category><![CDATA[BSD / Linux / Unix]]></category>
		<category><![CDATA[How to]]></category>
		<category><![CDATA[DHCP]]></category>
		<category><![CDATA[FreeBSD]]></category>
		<category><![CDATA[IPv6]]></category>
		<category><![CDATA[Native]]></category>
		<category><![CDATA[XS4ALL]]></category>

		<guid isPermaLink="false">http://kitara.nl/?p=5664</guid>
		<description><![CDATA[First you need to install a DHCP client cd /usr/ports/net/dhcp6 make install clean Setup config for dhcp6c cp /usr/local/etc/dhcp6c.conf.sample /usr/local/etc/dhcp6c.conf vi /usr/local/etc/dhcp6c.conf Add the following interface em0 { send ia-pd 0; }; &#160; id-assoc pd { prefix-interface em0 { sla-id 1; }; }; Add the following to /etc/rc.conf ipv6_enable=&#34;YES&#34; ipv6_network_interfaces=&#34;em0&#34; ipv6_defaultrouter=&#34;fe80::%em0&#34; dhcp6c_enable=&#34;YES&#34; dhcp6c_interfaces=&#34;em0&#34; Run the [...]]]></description>
			<content:encoded><![CDATA[<p>First you need to install a DHCP client</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>ports<span style="color: #000000; font-weight: bold;">/</span>net<span style="color: #000000; font-weight: bold;">/</span>dhcp6
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span> clean</pre></div></div>

<p>Setup config for dhcp6c</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">cp</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dhcp6c.conf.sample <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dhcp6c.conf
<span style="color: #c20cb9; font-weight: bold;">vi</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>dhcp6c.conf</pre></div></div>

<p>Add the following</p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">interface em0 {
    send ia-pd 0;
};
&nbsp;
id-assoc pd {
    prefix-interface em0 {
        sla-id 1;
    };
};</pre></div></div>

<p>Add the following to <strong>/etc/rc.conf</strong></p>

<div class="wp_syntax"><div class="code"><pre class="text" style="font-family:monospace;">ipv6_enable=&quot;YES&quot;
ipv6_network_interfaces=&quot;em0&quot;
ipv6_defaultrouter=&quot;fe80::%em0&quot;
dhcp6c_enable=&quot;YES&quot;
dhcp6c_interfaces=&quot;em0&quot;</pre></div></div>

<p>Run the IPv6 startup script.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>network_ipv6 restart</pre></div></div>

<p>Now startup the client</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>rc.d<span style="color: #000000; font-weight: bold;">/</span>dhcp6c start</pre></div></div>

<p>To test the connection you should be able to ping XS4ALL.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ping6 xs4all.nl</pre></div></div>

<p>You also might want to check out these posts for some more information:<br />
<a href="http://kitara.nl/2011/06/12/how-to-use-a-pppoe-or-pppoa-connection-of-xs4all-on-freebsd/" title="How to use a PPPoE or PPPoA connection of XS4ALL on FreeBSD" >How to use a PPPoE or PPPoA connection of XS4ALL on FreeBSD</a></p>
<p><a href="http://kitara.nl/2011/06/12/how-to-configure-ipv6-dhcp-client-for-xs4all-on-freebsd/" title="How to configure IPv6 DHCP client for XS4ALL on FreeBSD" >How to configure IPv6 DHCP client for XS4ALL on FreeBSD</a></p>
<p><a href="http://kitara.nl/2011/06/13/how-to-configure-a-ipv6-gateway-for-xs4all-on-freebsd/" title="How to configure a IPv6 gateway for XS4ALL on FreeBSD" >How to configure a IPv6 gateway for XS4ALL on FreeBSD</a></p>
]]></content:encoded>
			<wfw:commentRss>http://kitara.nl/2011/06/26/how-to-configure-a-automatically-native-ipv6-connection-on-freebsd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

