<?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>TheRosiek.com &#187; Tech Notes</title>
	<atom:link href="http://therosiek.com/category/tech-notes/feed/" rel="self" type="application/rss+xml" />
	<link>http://therosiek.com</link>
	<description>Random tech notes and tutorials</description>
	<lastBuildDate>Fri, 24 Jun 2011 19:16:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>SharePoint 2010 Error in Managed Service Accounts</title>
		<link>http://therosiek.com/2011/06/sp-2010-error-in-managed-service-accounts/</link>
		<comments>http://therosiek.com/2011/06/sp-2010-error-in-managed-service-accounts/#comments</comments>
		<pubDate>Fri, 24 Jun 2011 19:16:07 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[SharePoint]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=201</guid>
		<description><![CDATA[When working with SharePoint 2010 Central Administration, I ran into an issue where the page would display a generic "object not set to an instance of an object" when clicking on Configure managed accounts or Configure service accounts. My specific issue was that I changed the SPTimerV4 service to use a different account; I had [...]]]></description>
			<content:encoded><![CDATA[<p>When working with SharePoint 2010 Central Administration, I ran into an issue where the page would display a generic "object not set to an instance of an object" when clicking on <strong>Configure managed accounts</strong> or <strong>Configure service accounts</strong>.  My specific issue was that I changed the <em>SPTimerV4</em> service to use a different account; I had previously setup an sp_timer account and instead used the sp_farm account.  This is changed on the OS level since it is not listed in the <strong>Configure service accounts</strong>.  </p>
<p><a href="http://therosiek.com/wp-content/uploads/2011/06/sp_services_error.png"><img src="http://therosiek.com/wp-content/uploads/2011/06/sp_services_error-300x159.png" alt="" title="sp_services_error" width="300" height="159" class="aligncenter size-medium wp-image-191" /></a></p>
<p>Where I went wrong is that I deleted the sp_timer account out of Active Directory before I removed it from <strong>Configure managed accounts</strong>.  It seems that SharePoint should be able to handle this change, but it doesn't.  Create the domain account that you removed in Active Directory again.  Then open up <strong>SharePoint 2010 Management Shell</strong>, and be sure to open it <em>As Administrator</em>.  The following commands will remove the account from the list of managed accounts:</p>
<div class="codecolorer-container powershell vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="powershell codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #800080;">$rmacct</span> <span style="color: pink;">=</span> Get<span style="color: pink;">-</span>SPManagedAccount <span style="color: #800000;">&quot;MYDOMAIN\sp_timer&quot;</span><br />
<span style="color: #008000;"># make sure the variable output is coming up and there are no typos</span><br />
<span style="color: #800080;">$rmacct</span><br />
Remove<span style="color: pink;">-</span>SPManagedAccount $rmacct</div></div>
<p>Now you should be able to load the Central Administration web pages that were giving errors before properly.  Feel free to remove the old account from Active Directory.</p>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2011/06/sp-2010-error-in-managed-service-accounts/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NIC Teaming on Debian Squeeze</title>
		<link>http://therosiek.com/2011/03/nic-teaming-on-debian-squeeze/</link>
		<comments>http://therosiek.com/2011/03/nic-teaming-on-debian-squeeze/#comments</comments>
		<pubDate>Thu, 03 Mar 2011 14:53:15 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=179</guid>
		<description><![CDATA[NIC teaming on the newest version of Debian is incredibly easy. You'll need to know first what type of team you'd like to create: mode=0 (balance-rr) Round-robin policy: Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance. mode=1 (active-backup) Active-backup policy: Only one [...]]]></description>
			<content:encoded><![CDATA[<p>NIC teaming on the newest version of Debian is incredibly easy.  You'll need to know first what type of team you'd like to create:</p>
<ul>
<li><strong>mode=0 (balance-rr) Round-robin policy:</strong> Transmit packets in sequential order from the first available slave through the last. This mode provides load balancing and fault tolerance.</li>
<li><strong>mode=1 (active-backup) Active-backup policy:</strong> Only one slave in the bond is active. A different slave becomes active if, and only if, the active slave fails. The bond’s MAC address is externally visible on only one port (network adapter) to avoid confusing the switch. This mode provides fault tolerance. The primary option affects the behavior of this mode.</li>
<li><strong>mode=2 (balance-xor) XOR policy:</strong> Transmit based on source MAC address XOR'd with destination MAC address. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.</li>
<li><strong>mode=3 (broadcast) Broadcast policy:</strong> Transmits everything on all slave interfaces. This mode provides fault tolerance.
<li><strong>mode=4 (802.3ad) IEEE 802.3ad Dynamic link aggregation:</strong> Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.  Ethtool support in the base drivers for retrieving the speed and duplex of each slave.  A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode.</li>
<li><strong>mode=5 (balance-tlb) Adaptive transmit load balancing:</strong> Channel bonding that does not require any special switch support. The outgoing traffic is distributed according to the current load (computed relative to the speed) on each slave. Incoming traffic is received by the current slave. If the receiving slave fails, another slave takes over the MAC address of the failed receiving slave.  Ethtool support in the base drivers for retrieving the speed of each slave.</li>
<li><strong>mode=6 (balance-alb) Adaptive load balancing:</strong>  Includes balance-tlb plus receive load balancing (rlb) for IPV4 traffic, and does not require any special switch support. The receive load balancing is achieved by ARP negotiation. The bonding driver intercepts the ARP Replies sent by the local system on their way out and overwrites the source hardware address with the unique hardware address of one of the slaves in the bond such that different peers use different hardware addresses for the server.</li>
</ul>
<p>Once you choose your team method, install the ifenslave package</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get install</span> ifenslave-<span style="color: #000000;">2.6</span></div></div>
<p>Now open the file <strong>/etc/network/interfaces</strong> and add the bonded interface:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># The primary network interface<br />
auto bond0<br />
iface bond0 inet static<br />
&nbsp; &nbsp; &nbsp; &nbsp; address 192.168.20.20<br />
&nbsp; &nbsp; &nbsp; &nbsp; netmask 255.255.255.0<br />
&nbsp; &nbsp; &nbsp; &nbsp; broadcast 192.168.20.255<br />
&nbsp; &nbsp; &nbsp; &nbsp; network 192.168.20.0<br />
&nbsp; &nbsp; &nbsp; &nbsp; gateway 192.168.20.1<br />
&nbsp; &nbsp; &nbsp; &nbsp; bond_mode active-backup<br />
&nbsp; &nbsp; &nbsp; &nbsp; bond_miimon 100<br />
&nbsp; &nbsp; &nbsp; &nbsp; bond_downdelay 200<br />
&nbsp; &nbsp; &nbsp; &nbsp; bond_updelay 200<br />
&nbsp; &nbsp; &nbsp; &nbsp; slaves eth0 eth1</div></div>
<p>Note that <strong>bond_mode</strong> is the teaming option you selected above.  You can restart the networking service, or just reboot the server to ensure the team comes up after shutdown.</p>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2011/03/nic-teaming-on-debian-squeeze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nagios Setup on Debian Lenny</title>
		<link>http://therosiek.com/2010/10/nagios-setup-on-debian-lenny/</link>
		<comments>http://therosiek.com/2010/10/nagios-setup-on-debian-lenny/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 19:21:31 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Nagios]]></category>
		<category><![CDATA[Network Monitoring]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=168</guid>
		<description><![CDATA[Below are instructions on building Nagios from scratch on Debian Lenny. These instructions also make it very easy to update the build when new ones come out. Apache Configuration Nagios Install Prerequisites Install Configuration Third Party Tools Plugins NRPE PNP Graphing General Use Apache Configuration First install the essential packages needed to compile and use [...]]]></description>
			<content:encoded><![CDATA[<p>Below are instructions on building Nagios from scratch on Debian Lenny.  These instructions also make it very easy to update the build when new ones come out.</p>
<ul>
<li><a href="#1">Apache Configuration</a></li>
<li><a href="#2">Nagios Install</a></li>
<ul>
<li><a href="#3">Prerequisites</a></li>
<li><a href="#4">Install</a></li>
<li><a href="#5">Configuration</a></li>
</ul>
<li><a href="#6">Third Party Tools</a></li>
<ul>
<li><a href="#7">Plugins</li>
<li><a href="#8">NRPE</li>
<li><a href="#9">PNP Graphing</li>
</ul>
<li><a href="#10">General Use</a></li>
</ul>
<hr />
<p><a name="1"></a></p>
<h2>Apache Configuration</h2>
<p>First install the essential packages needed to compile and use Nagios.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get install</span> apache2 php5 openssl xfsprogs build-essential <span style="color: #c20cb9; font-weight: bold;">autoconf</span> libgd2-xpm-dev libssl-dev ntpdate libperl-dev libnet-snmp-perl libdbd-sybase-perl libxml2-dev libmysqlclient15-dev mailx</div></div>
<p>Modify the file <strong>/etc/apache2/apache2.conf</strong> so that it's a bit cleaner.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:350px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ServerRoot &quot;/etc/apache2&quot;<br />
<br />
LockFile /var/lock/apache2/accept.lock<br />
PidFile ${APACHE_PID_FILE}<br />
Timeout 300<br />
KeepAlive On<br />
MaxKeepAliveRequests 25<br />
KeepAliveTimeout 15<br />
<br />
&lt;IfModule mpm_prefork_module&gt;<br />
&nbsp; &nbsp; StartServers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;5<br />
&nbsp; &nbsp; MinSpareServers &nbsp; &nbsp; &nbsp; 5<br />
&nbsp; &nbsp; MaxSpareServers &nbsp; &nbsp; &nbsp;10<br />
&nbsp; &nbsp; MaxClients &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;150<br />
&nbsp; &nbsp; MaxRequestsPerChild &nbsp; 0<br />
&lt;/IfModule&gt;<br />
<br />
&lt;IfModule mpm_worker_module&gt;<br />
&nbsp; &nbsp; StartServers &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;2<br />
&nbsp; &nbsp; MaxClients &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;150<br />
&nbsp; &nbsp; MinSpareThreads &nbsp; &nbsp; &nbsp;25<br />
&nbsp; &nbsp; MaxSpareThreads &nbsp; &nbsp; &nbsp;75<br />
&nbsp; &nbsp; ThreadsPerChild &nbsp; &nbsp; &nbsp;25<br />
&nbsp; &nbsp; MaxRequestsPerChild &nbsp; 0<br />
&lt;/IfModule&gt;<br />
<br />
User ${APACHE_RUN_USER}<br />
Group ${APACHE_RUN_GROUP}<br />
<br />
AccessFileName .htaccess<br />
&lt;Files ~ &quot;^\.ht&quot;&gt;<br />
&nbsp; &nbsp; Order allow,deny<br />
&nbsp; &nbsp; Deny from all<br />
&lt;/Files&gt;<br />
<br />
DefaultType text/plain<br />
HostnameLookups Off<br />
<br />
ErrorLog /var/log/apache2/error.log<br />
LogLevel warn<br />
<br />
# Include module configuration:<br />
Include /etc/apache2/mods-enabled/*.load<br />
Include /etc/apache2/mods-enabled/*.conf<br />
<br />
# Include all the user configurations:<br />
Include /etc/apache2/httpd.conf<br />
<br />
# Include ports listing<br />
Include /etc/apache2/ports.conf<br />
<br />
LogFormat &quot;%v:%p %h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; vhost_combined<br />
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b \&quot;%{Referer}i\&quot; \&quot;%{User-Agent}i\&quot;&quot; combined<br />
LogFormat &quot;%h %l %u %t \&quot;%r\&quot; %&gt;s %b&quot; common<br />
LogFormat &quot;%{Referer}i -&gt; %U&quot; referer<br />
LogFormat &quot;%{User-agent}i&quot; agent<br />
<br />
CustomLog /var/log/apache2/other_vhosts_access.log vhost_combined<br />
<br />
# Include generic snippets of statements<br />
Include /etc/apache2/conf.d/<br />
<br />
# Include the virtual host configurations:<br />
Include /etc/apache2/sites-enabled/</div></div>
<p>Now create the Apache configuration file for Nagios so it can load the web interface. Create the file <strong>/etc/apache2/conf.d/nagios.conf</strong> with the following:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ScriptAlias /nagios/cgi-bin &quot;/usr/local/nagios/sbin&quot;<br />
<br />
&lt;Directory &quot;/usr/local/nagios/sbin&quot;&gt;<br />
&nbsp; &nbsp;Options ExecCGI<br />
&nbsp; &nbsp;AllowOverride None<br />
&nbsp; &nbsp;Order allow,deny<br />
&nbsp; &nbsp;Allow from all<br />
&nbsp; &nbsp;AuthName &quot;Nagios Access&quot;<br />
&nbsp; &nbsp;AuthType Basic<br />
&nbsp; &nbsp;AuthUserFile /etc/nagios/htpasswd.users<br />
&nbsp; &nbsp;Require valid-user<br />
&nbsp; &nbsp;SetEnv TZ &quot;US/Eastern&quot;<br />
&lt;/Directory&gt;<br />
<br />
Alias /nagios &quot;/usr/local/nagios/share&quot;<br />
<br />
&lt;Directory &quot;/usr/local/nagios/share&quot;&gt;<br />
&nbsp; &nbsp;Options None<br />
&nbsp; &nbsp;AllowOverride None<br />
&nbsp; &nbsp;Order allow,deny<br />
&nbsp; &nbsp;Allow from all<br />
&nbsp; &nbsp;AuthName &quot;Nagios Access&quot;<br />
&nbsp; &nbsp;AuthType Basic<br />
&nbsp; &nbsp;AuthUserFile /etc/nagios/htpasswd.users<br />
&nbsp; &nbsp;Require valid-user<br />
&lt;/Directory&gt;</div></div>
<p>Modify <strong>/etc/apache2/ports.conf</strong> to have just one line to listen for SSL:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Listen 443</div></div>
<p>Modify <strong>/etc/apache2/mods-available/ssl.conf</strong> to clean up the SSL configuration, we'll enable this later.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&lt;IfModule mod_ssl.c&gt;<br />
<br />
SSLRandomSeed startup builtin<br />
SSLRandomSeed startup file:/dev/urandom 512<br />
SSLRandomSeed connect builtin<br />
SSLRandomSeed connect file:/dev/urandom 512<br />
<br />
AddType application/x-x509-ca-cert .crt<br />
AddType application/x-pkcs7-crl &nbsp; &nbsp;.crl<br />
SSLPassPhraseDialog &nbsp;builtin<br />
SSLSessionCache &nbsp; &nbsp; &nbsp; &nbsp;shmcb:/var/run/apache2/ssl_scache(512000)<br />
SSLSessionCacheTimeout &nbsp;300<br />
SSLMutex &nbsp;file:/var/run/apache2/ssl_mutex<br />
SSLCipherSuite HIGH:MEDIUM:!ADH<br />
SSLProtocol all -SSLv2<br />
<br />
&lt;/IfModule&gt;</div></div>
<p>Create the file <strong>/etc/apache2/sites-available/nagios-ssl</strong> for the virtual directory routing information.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NameVirtualHost *<br />
&lt;VirtualHost *&gt;<br />
&nbsp; &nbsp; &nbsp; &nbsp; ServerAdmin webmaster@localhost<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; CustomLog /var/log/apache2/access.log combined<br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; SSLEngine on<br />
&nbsp; &nbsp; &nbsp; &nbsp; SSLCertificateFile &nbsp; &nbsp;/etc/ssl/private/apache-self-signed.crt<br />
&nbsp; &nbsp; &nbsp; &nbsp; SSLCertificateKeyFile /etc/ssl/private/apache-priv.key<br />
<br />
&lt;/VirtualHost&gt;</div></div>
<p>Modify the file <strong>/etc/apache2/httpd.conf</strong> so it has just one line:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">ServerName server.domain.com</div></div>
<p>Now we can enable our modules and sites in Apache.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">a2enmod ssl<br />
a2dissite default<br />
a2ensite nagios-ssl</div></div>
<p>Now create a self signed certificate to use for the site, or a third party if necessary.</p>
<p><a name="2"></a></p>
<h2>Nagios Install</h2>
<p><a name="3"></a></p>
<h3>Prerequisites</h3>
<p>Setup our users and groups that will run Nagios. Note that the <strong>www-root</strong> user is specific to Debian since that user runs the Apache web process:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd <span style="color: #660033;">-g</span> <span style="color: #000000;">9000</span> nagios<br />
groupadd <span style="color: #660033;">-g</span> <span style="color: #000000;">9001</span> nagcmd<br />
usermod <span style="color: #660033;">-G</span> nagcmd www-data<br />
useradd <span style="color: #660033;">-u</span> <span style="color: #000000;">9000</span> <span style="color: #660033;">-g</span> nagios <span style="color: #660033;">-G</span> nagcmd <span style="color: #660033;">-d</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>nagios <span style="color: #660033;">-c</span> <span style="color: #ff0000;">&quot;Nagios Admin&quot;</span> nagios</div></div>
<p>Now setup the initial directories and permissions where we'll keep the files. I chose to create /var/nagios because that's where I'll store the data files since it's the largest partition and meant for variable data.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</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>nagios<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> nagios:nagios <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>nagios <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios</div></div>
<p>Download the Nagios source and unpack.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>superb-east.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>nagios-<span style="color: #000000;">3</span>.x.x.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf nagios-<span style="color: #000000;">3</span>.x.x.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> nagios-<span style="color: #000000;">3</span>.x.x</div></div>
<p><a name="4"></a></p>
<h3>Install</h3>
<p>Configure and build Nagios for the proper directories and options.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--sysconfdir</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios <span style="color: #660033;">--localstatedir</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios <span style="color: #660033;">--with-command-group</span>=nagcmd <span style="color: #660033;">--with-perlcache</span> <span style="color: #660033;">--enable-embedded-perl</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> all<br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> install-init<br />
<span style="color: #c20cb9; font-weight: bold;">make</span> install-commandmode<br />
<span style="color: #c20cb9; font-weight: bold;">make</span> install-config</div></div>
<p>Set Nagios to start on boot and set the password Apache file to authenticate users.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">update-rc.d nagios defaults <span style="color: #000000;">99</span><br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span><br />
htpasswd <span style="color: #660033;">-c</span> htpasswd.users nagios<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> www-data htpasswd.users<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> htpasswd.users</div></div>
<p>To add more users to the <strong>htpasswd.users</strong> file just type</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">htpasswd htpasswd.users username</div></div>
<p>since the -c is only for file creation.</p>
<p><a name="5"></a></p>
<h3>Configuration</h3>
<p>Edit the file <strong>/etc/nagios/cgi.cfg</strong> and modify any "authorized" line to include the users you created in the <strong>htpassswd.users</strong> file, for example:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">authorized_for_system_information=nagios,user1,user2</div></div>
<p>Create a folder in <strong>/etc/nagios</strong> to contain all the configuration files. Typically the site name is a good choice. Once the folder is created, modify the file <strong>/etc/nagios/nagios.cfg</strong> and remove all the "cfg_file" entries and add the line:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cfg_dir=/etc/nagios/site1</div></div>
<p>Or whatever folder you created for your config files, site1 in this example.</p>
<p>Now add some images for icon view to the base install. These packs can usually be downloaded from the Nagios Exchange.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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>local<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>share<span style="color: #000000; font-weight: bold;">/</span>images<span style="color: #000000; font-weight: bold;">/</span>logos<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf image_logos.tar.gz</div></div>
<p><a name="6"></a></p>
<h2>Third Party Tools</h2>
<p><a name="7"></a></p>
<h3>Plugins</h3>
<p>The Nagios plugins are necessary to run checks on server processes and health. In the configure statement, be sure to use the same folder locations as when Nagios itself was configured. Plugins will be installed in the <strong>/usr/local/nagios/libexec</strong> directory.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>superb-east.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>nagios-plugins<span style="color: #000000; font-weight: bold;">/</span>nagios-plugins-<span style="color: #000000;">1.4</span>.xx.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf nagios-plugins-<span style="color: #000000;">1.4</span>.xx.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> nagios-plugins-<span style="color: #000000;">1.4</span>.xx<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--sysconfdir</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios <span style="color: #660033;">--localstatedir</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios <span style="color: #660033;">--enable-perl-modules</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> check<br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p><a name="8"></a></p>
<h3>NRPE</h3>
<p>This install adds the NRPE plugin so that checks can be done on other servers securely and remotely. The NRPE client/server doesn't need to be installed on the Nagios server; it just needs the plugin to run the checks. The remote servers of course need the NRPE client installed. Again, take note of the configure directors and that --<strong>enable-ssl=yes</strong> is set to yes. This allows for a secure SSL handshake.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>superb-east.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>sourceforge<span style="color: #000000; font-weight: bold;">/</span>nrpe<span style="color: #000000; font-weight: bold;">/</span>nrpe-<span style="color: #000000;">2</span>.xx.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf nrpe-<span style="color: #000000;">2</span>.xx.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> nrpe-<span style="color: #000000;">2</span>.xx<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--sysconfdir</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios <span style="color: #660033;">--localstatedir</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>nagios <span style="color: #660033;">--enable-ssl</span>=<span style="color: #c20cb9; font-weight: bold;">yes</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> all<br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p><a name="9"></a></p>
<h3>PNP Graphing</h3>
<p>A couple packages are needed first as well as mod_rewrite for Apache:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get install</span> rrdtool librrds-perl php5-gd<br />
a2enmod rewrite</div></div>
<p>Open <strong>/etc/php5/apache2/php.in</strong>i and make sure the following is set to <strong>Off</strong>:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">magic_quotes_gpc = Off</div></div>
<p>Then restart Apache to have the setting take effect:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</div></div>
<p>Download, configure and install PNP. Note directory locations in configure.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>voxel.dl.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>pnp4nagios<span style="color: #000000; font-weight: bold;">/</span>PNP-<span style="color: #000000;">0.6</span><span style="color: #000000; font-weight: bold;">/</span>pnp4nagios-<span style="color: #000000;">0.6</span>.x.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf pnp4nagios-<span style="color: #000000;">0.6</span>.x.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> pnp4nagios-<span style="color: #000000;">0.6</span>.x<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--sysconfdir</span>=<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>pnp <span style="color: #660033;">--localstatedir</span>=<span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>pnp4nagios<br />
<span style="color: #c20cb9; font-weight: bold;">make</span> all<br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> install-webconf<br />
<span style="color: #c20cb9; font-weight: bold;">make</span> install-config</div></div>
<p>Setup the base configuration:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">cd /etc/pnp<br />
cp process_perfdata.cfg-sample process_perfdata.cfg<br />
cp rra.cfg-sample rra.cfg<br />
cd /etc/nagios</div></div>
<p>Edit <strong>/etc/nagios/nagios.cfg</strong> to turn on some switches and make performance data go to PNP. Typically these are commented out to start.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">service_perfdata_command=service-perfdata-pnp<br />
process_performance_data=1</div></div>
<p>Add the new command to <strong>commands.cfg</strong> in <strong>/etc/nagios/site1</strong> or wherever your commands for the site are stored:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">define command {<br />
&nbsp; &nbsp; &nbsp;command_name &nbsp; &nbsp;service-perfdata-pnp<br />
&nbsp; &nbsp; &nbsp;command_line &nbsp; &nbsp;/usr/bin/perl /usr/local/pnp4nagios/libexec/process_perfdata.pl<br />
}</div></div>
<p>Modify <strong>/etc/apache2/conf.d/pnp4nagios.conf</strong> to include the same password file that Nagios uses. This file is created by the install scripts.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">AuthUserFile /etc/nagios/htpasswd.users</div></div>
<p>Restart Apache for the changes to take effect. You can now navigate to https://hostname/pnp4nagios and see the install checklist. If all is complete, remove the <strong>/usr/local/pnp4nagios/share/install.php</strong> file.</p>
<p><a name="10"></a></p>
<h2>General Use</h2>
<p>For Nagios to function, it first needs to be started with this command:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nagios start</div></div>
<p>If a configuration or syntax error in your configuration occurs, you can test the output and find out where it is by running this command:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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>nagios<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>nagios <span style="color: #660033;">-v</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>nagios<span style="color: #000000; font-weight: bold;">/</span>nagios.cfg</div></div>
<p>Now you can try starting Nagios again. If you make configuration changes, the configuration must be reloaded. Do this use:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>nagios reload</div></div>
<p>To access Nagios through the web, Apache must be started, or restarted if it already was running. This will also accept the new web configurations that may have been made:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 start<br />
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2010/10/nagios-setup-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Server path error in vSphere 4.1</title>
		<link>http://therosiek.com/2010/07/server-path-error-in-vsphere-4-1/</link>
		<comments>http://therosiek.com/2010/07/server-path-error-in-vsphere-4-1/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 03:38:23 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[VMware]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=160</guid>
		<description><![CDATA[First off, this is related to the post in VMware Communities here: http://communities.vmware.com/message/1576370 I recently updated a VMware Infrastructure to vCenter 4.1. All ESX servers were still on ESXi 3.5. This shouldn't be a problem, you just can't use some of the new features available in 4.1. That's fine, except that I couldn't view the [...]]]></description>
			<content:encoded><![CDATA[<p>First off, this is related to the post in VMware Communities here: <a href="http://communities.vmware.com/message/1576370">http://communities.vmware.com/message/1576370</a></p>
<p>I recently updated a VMware Infrastructure to vCenter 4.1.  All ESX servers were still on ESXi 3.5.  This shouldn't be a problem, you just can't use some of the new features available in 4.1.  That's fine, except that I couldn't view the managed paths in the ESX servers.  I would get the error below.  I would get the same error when trying to manually migrate a virtual machine to a different ESX server.</p>
<p><a href="http://therosiek.com/wp-content/uploads/2010/07/vmware-storage-error1.png"><img src="http://therosiek.com/wp-content/uploads/2010/07/vmware-storage-error1-300x222.png" alt="vmware error" title="vmware-storage-error1" width="300" height="222" class="size-medium wp-image-159" /></a></p>
<p>You can see the error states <strong>Item has already been added.  Key in dictionary: 'Vmomi.Host.PlugStoreTopology+Path' Key being added: 'Vmomi.Host.PlugStoreTopology+Path'</strong>.  And of course you can see that two entries are listed.</p>
<p>I tried multiple solutions, including completely reinstalling vCenter with a new database and reconfiguring.  Restarting the ESX servers didn't matter.  The real solution was upgrading all of the ESXi servers to 4.1.  This shouldn't seem necessary, but the upgrade through Upgrade Manager (they got rid of the Host Update Utility after 4.0) was relatively easy and smooth.  After having issues with vCenter 4.1 I was reluctant to move the ESX servers there, but so far everything is working great, including migrations and managed paths.</p>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2010/07/server-path-error-in-vsphere-4-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Latest and greatest Subversion on Debian Lenny</title>
		<link>http://therosiek.com/2010/07/latest-and-greatest-subversion-on-debian-lenny/</link>
		<comments>http://therosiek.com/2010/07/latest-and-greatest-subversion-on-debian-lenny/#comments</comments>
		<pubDate>Thu, 15 Jul 2010 14:13:37 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=157</guid>
		<description><![CDATA[Debian has its own package for Subversion, but most of the time you want to use the latest Subversion package that's out there. This explains how to build and use that over Apache and HTTPS. Installation Configuration Maintenance and Use Installation This particular install does not use the Berkeley DB method of code repository storage, [...]]]></description>
			<content:encoded><![CDATA[<p>Debian has its own package for Subversion, but most of the time you want to use the latest Subversion package that's out there.  This explains how to build and use that over Apache and HTTPS.</p>
<ul>
<li><a href="#1">Installation</a></li>
<li><a href="#2">Configuration</a></li>
<li><a href="#3">Maintenance and Use</a></li>
</ul>
<hr />
<p><a name="1"></a></p>
<h2>Installation</h2>
<p>This particular install does not use the Berkeley DB method of code repository storage, but rather the flat file system storage method. Both have their advantages, but the file is believed to be faster. Read more <a href="http://svnbook.red-bean.com/en/1.5/svn.reposadmin.planning.html#svn.reposadmin.basics.backends">here</a>.</p>
<p>First setup Apache and get all the Subversion dependencies.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get install</span> apache2<br />
<span style="color: #c20cb9; font-weight: bold;">apt-get build-dep</span> subversion<br />
<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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>subversion.tigris.org<span style="color: #000000; font-weight: bold;">/</span>downloads<span style="color: #000000; font-weight: bold;">/</span>subversion-1.6.13.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf subversion-1.6.13.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> subversion-1.6.13<br />
.<span style="color: #000000; font-weight: bold;">/</span>configure <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></div></div>
<p>Then we get this warning, but FSFS is fine to use instead of Berkeley.</p>
<pre>configure: WARNING: we have configured without BDB filesystem support

You don't seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL.  We have created Makefiles which
will build without the Berkeley DB back-end; your repositories will
use FSFS as the default back-end.  You can find the latest version of
Berkeley DB here:

http://www.oracle.com/technology/software/products/berkeley-db/index.html</pre>
<p>Continue with the build:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">make</span><br />
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>After install, this error comes up, but it can be ignored and the next few steps will fix.</p>
<pre>apxs:Error: Activation failed for custom /etc/apache2/httpd.conf file..
apxs:Error: At least one `LoadModule' directive already has to exist..
make: *** [install-mods-shared] Error 1</pre>
<p>Create the file <strong>/etc/apache2/mods-available/dav_svn.load</strong> with the following:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"># Depends: dav<br />
LoadModule dav_svn_module /usr/lib/apache2/modules/mod_dav_svn.so<br />
LoadModule authz_svn_module /usr/lib/apache2/modules/mod_authz_svn.so</div></div>
<p>Copy over the modules from source and install them in the Apache directories; also enable SSL since we want to push this over a secure channel:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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>src<span style="color: #000000; font-weight: bold;">/</span>subversion-1.6.11<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>mod_dav_svn<span style="color: #000000; font-weight: bold;">/</span>.libs<span style="color: #000000; font-weight: bold;">/</span>mod_dav_svn.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span><br />
<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>src<span style="color: #000000; font-weight: bold;">/</span>subversion-1.6.11<span style="color: #000000; font-weight: bold;">/</span>subversion<span style="color: #000000; font-weight: bold;">/</span>mod_authz_svn<span style="color: #000000; font-weight: bold;">/</span>.libs<span style="color: #000000; font-weight: bold;">/</span>mod_authz_svn.so <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>apache2<span style="color: #000000; font-weight: bold;">/</span>modules<span style="color: #000000; font-weight: bold;">/</span><br />
a2enmod dav_svn<br />
a2enmod ssl</div></div>
<p><a name="2"></a></p>
<h2>Configuration</h2>
<p>Create the file <strong>/etc/apache2/sites-available/svn</strong> so that Apache knows about the SVN repository:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">NameVirtualHost svn.mysite.com:443<br />
<br />
&lt;VirtualHost svn.mysite.com:443&gt;<br />
<br />
DocumentRoot /var/svn<br />
<br />
# SSL Definitions<br />
SSLEngine on<br />
SSLCertificateFile /etc/ssl/private/myserver_svn.crt<br />
SSLCertificateKeyFile /etc/ssl/private/myserver_svn.key<br />
<br />
# Subversion<br />
&lt;Location /svn&gt;<br />
&nbsp; &nbsp; DAV svn<br />
&nbsp; &nbsp; SVNListParentPath on<br />
&nbsp; &nbsp; SVNParentPath /var/svn<br />
&nbsp; &nbsp; AuthType Basic<br />
&nbsp; &nbsp; AuthName &quot;Subversion Repository&quot;<br />
&nbsp; &nbsp; AuthUserFile /etc/svn/dav_svn.passwd<br />
&nbsp; &nbsp; AuthzSVNAccessFile /etc/svn/dav_svn.control<br />
&nbsp; &nbsp; Require valid-user<br />
&lt;/Location&gt;<br />
&lt;/VirtualHost&gt;</div></div>
<p>Now enable the site and start/restart Apache:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">a2ensite <span style="color: #c20cb9; font-weight: bold;">svn</span><br />
<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</div></div>
<p>Setup the initial repository with the svncreate command and make the user running the web service the owner, since they will be the user actually modifying the repository files.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><br />
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>myproject<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>myproject</div></div>
<p>Now we can create the username/password files along with the access files.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span><br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.passwd<br />
htpasswd <span style="color: #660033;">-mb</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.passwd myuser mypassword</div></div>
<p>Create the access file to your repositories.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.control</div></div>
<p>And now edit the file. You can set users using r and rw access writes. First you list the repository, and then the folder location after that for more fine grained permissions.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[myproject:/]<br />
myuser = r<br />
<br />
[myproject:/trunk/base/code]<br />
myuser = rw</div></div>
<p>Now reboot the server and test access; it should start up automatically.</p>
<p><a name="3"></a></p>
<h2>Maintenance and Use</h2>
<p>The best way to use SVN over HTTPS is with Tortoise for Windows or some other tool if using Linux, like RapidSVN.</p>
<h3>Adding Additional Users</h3>
<p>To add more users, just run the htpasswd command linked to your <strong>dav_svn.passwd</strong> file, same as the initial configuration for users.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">htpasswd <span style="color: #660033;">-mb</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>dav_svn.passwd newuser newpassword</div></div>
<p>And now edit the access file containing the other users and defined in the Apache configuration. You can set users using r and rw access writes. First you list the repository, and then the folder location after that for more fine grained permissions.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[myproject:/]<br />
myuser = r<br />
newuser = r<br />
<br />
[myproject:/trunk/base/code]<br />
myuser = rw<br />
newuser = rw</div></div>
<h3>Backing Up the Repositories</h3>
<p>To backup a repository, use the svnadmin dump command which will export the entire database and revisions. You can then tar up and gzip the dump file for compression, and back it up to tape or disk somewhere else. There are also incremental backups that can be done of disk/tape space is an issue.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> dump <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>myproject <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>myproject_dumpfile</div></div>
<h3>Restoring the Repositories</h3>
<p>Restoring the SVN database is simply rewriting all the revisions from the dump back into a database. The restore process also works well for moving an older repository over to a new one since restoring the dump into a new SVN database will update it to that version.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> create <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject<br />
<span style="color: #c20cb9; font-weight: bold;">svnadmin</span> load <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>backups<span style="color: #000000; font-weight: bold;">/</span>myproject_dumpfile<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> <span style="color: #660033;">-R</span> www-data:www-data <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject<br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #660033;">-R</span> <span style="color: #000000;">770</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>restoredproject</div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2010/07/latest-and-greatest-subversion-on-debian-lenny/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Duplicity Install and Backup Samples</title>
		<link>http://therosiek.com/2010/01/duplicity-install-and-backup-samples/</link>
		<comments>http://therosiek.com/2010/01/duplicity-install-and-backup-samples/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 17:54:45 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[OpenBSD]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=150</guid>
		<description><![CDATA[Duplicity is a backup tool that works off of rsync and rdiff libraries to copy only changes to a backup location. It can use compression and encryption tools on the data and also has the ability to save to Amazon's S3 service. More details can be found here. Installation on OpenBSD 4.4 Installation on OpenBSD [...]]]></description>
			<content:encoded><![CDATA[<p>Duplicity is a backup tool that works off of rsync and rdiff libraries to copy only changes to a backup location. It can use compression and encryption tools on the data and also has the ability to save to Amazon's S3 service. More details can be found <a href="http://duplicity.nongnu.org/">here</a>.</p>
<ul>
<li><a href="#1">Installation on OpenBSD 4.4</a></li>
<li><a href="#2">Installation on OpenBSD 4.6</a></li>
<li><a href="#3">Installation on Debian Lenny 5.0</a></li>
<li><a href="#4">Sample Backup Scripts</a></li>
</ul>
<hr />
<p><a name="1"></a></p>
<h2>Installation on OpenBSD 4.4</h2>
<p>The 4.4 version was the most difficult to get working since the majority of the issues came from the given OpenBSD libraries. Even installing the Duplicity port from the packages didn't function right.</p>
<p>First we need to add a few packages. You can use the <strong>pkg_add</strong> function with whatever mirror to obtain the following, some depend on others so there will be others in the file install list:</p>
<ul>
<li>python-2.5.2p4</li>
<li>py-boto-1.3</li>
<li>gpgme-1.1.5</li>
<li>librsync-0.9.7</li>
<li>ncftp-3.2.1</li>
</ul>
<p>When the main Python package is installed, it will ask you to create a few symbolic links, so create those.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</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>python2.5 <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>python<br />
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</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>pydoc2.5 &nbsp;<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>pydoc</div></div>
<p>Version 4.4 needs a separate Python XML package to work properly. If it's not installed, you'll get a series of errors when trying to send data to S3; I believe the XML error is when it tries to read the response. Something like this will error out:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Traceback (most recent call last):<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 482, in &lt;module&gt;<br />
&nbsp; &nbsp; with_tempdir(main)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 477, in with_tempdir<br />
&nbsp; &nbsp; fn()<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 468, in main<br />
&nbsp; &nbsp; full_backup(col_stats)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 174, in full_backup<br />
&nbsp; &nbsp; col_stats.set_values(sig_chain_warning = None).cleanup_signatures()<br />
&nbsp; File &quot;/usr/obj/ports/duplicity-0.4.12/fake-amd64/usr/local/lib/python2.5/site-packages/duplicity/collections.py&quot;, line 476, in set_values<br />
&nbsp; File &quot;/usr/obj/ports/duplicity-0.4.12/fake-amd64/usr/local/lib/python2.5/site-packages/duplicity/backends.py&quot;, line 802, in list<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/boto/s3/bucketlistresultset.py&quot;, line 31, in bucket_lister<br />
&nbsp; &nbsp; delimiter=delimiter)<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/boto/s3/bucket.py&quot;, line 205, in get_all_keys<br />
&nbsp; &nbsp; xml.sax.parseString(body, h)<br />
&nbsp; File &quot;/usr/local/lib/python2.5/xml/sax/__init__.py&quot;, line 43, in parseString<br />
&nbsp; &nbsp; parser = make_parser()<br />
&nbsp; File &quot;/usr/local/lib/python2.5/xml/sax/__init__.py&quot;, line 93, in make_parser<br />
&nbsp; &nbsp; raise SAXReaderNotAvailable(&quot;No parsers found&quot;, None)<br />
xml.sax._exceptions.SAXReaderNotAvailable: No parsers found</div></div>
<p>To avoid that, a separate Python XML package needs to be downloaded and installed:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>downloads.sourceforge.net<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>pyxml<span style="color: #000000; font-weight: bold;">/</span>pyxml<span style="color: #000000; font-weight: bold;">/</span>0.8.4<span style="color: #000000; font-weight: bold;">/</span>PyXML-0.8.4.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf PyXML-0.8.4.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> PyXML-0.8.4<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>Now we can install Duplicity.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>code.launchpad.net<span style="color: #000000; font-weight: bold;">/</span>duplicity<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.6</span>-series<span style="color: #000000; font-weight: bold;">/</span>0.6.06<span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>duplicity-0.6.06.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> duplicity-0.6.06<br />
python setup.py <span style="color: #660033;">--librsync-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span> build<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></div></div>
<p>If you run the Duplicity jobs as root in a cron job, there is something about OpenBSD (I'm sure a security issue) that causes it to fail. I would get the output below in my log only when it ran as a cron job:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Traceback (most recent call last):<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 583, in &lt;module&gt;<br />
&nbsp; &nbsp; with_tempdir(main)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 577, in with_tempdir<br />
&nbsp; &nbsp; fn()<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 558, in main<br />
&nbsp; &nbsp; full_backup(col_stats)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 234, in full_backup<br />
&nbsp; &nbsp; bytes_written = write_multivol(&quot;full&quot;, tarblock_iter, globals.backend)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 148, in write_multivol<br />
&nbsp; &nbsp; globals.gpg_profile, globals.volsize)<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/duplicity/gpg.py&quot;, line 240, in GPGWriteFile<br />
&nbsp; &nbsp; bytes_to_go = data_size - get_current_size()<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/duplicity/gpg.py&quot;, line 232, in get_current_size<br />
&nbsp; &nbsp; return os.stat(filename).st_size<br />
OSError: [Errno 2] No such file or directory:'/tmp/duplicity-gM4CN9-tempdir/mktemp-iZknw0-2'</div></div>
<p>Odd that it can't read the temporary folder that it created. Changing the folder location also did not work. The solution is to create a separate user for only backups. The can be an issue if you have files that cannot be read by all users and need backup, but I found in my case this worked for the specific files that needed to be saved.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">useradd <span style="color: #660033;">-m</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'Duplicity'</span> dpbackup<br />
usermod <span style="color: #660033;">-G</span> nogroup dpbackup<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>log</div></div>
<p>Make sure to add the new user to the deny list in SSH with <strong>DenyUsers dpbackup</strong> in the file <em>/etc/ssh/sshd_config</em>; there isn't any reason for it to log in.</p>
<p>Now su as this new user. A GPG key needs to be created so that the compressed backups can be encrypted and signed. This way no one else that may have access to our S3 account (Amazon employees) can read the data.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">su</span> dpbackup<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span><br />
$ gpg <span style="color: #660033;">--list-keys</span><br />
gpg: directory <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #ff0000;">' created<br />
gpg: new configuration file `/root/.gnupg/gpg.conf'</span> created<br />
gpg: WARNING: options <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>gpg.conf<span style="color: #ff0000;">' are not yet active during this run<br />
gpg: keyring `/root/.gnupg/pubring.gpg'</span> created<br />
gpg: <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>trustdb.gpg: trustdb created<br />
<br />
$ gpg <span style="color: #660033;">--gen-key</span></div></div>
<p>There will be a series of questions, most of the defaults are fine.</p>
<ul>
<li>Choose option 1 for DSA and Elgamal (the default)</li>
<li>Choose the default key size of 2048</li>
<li>Leave the default that the key will not expire, option 0</li>
<li>Enter a User ID, Email address, and comment for the key.</li>
<li>Type O for OK to accept.</li>
<li>Enter a long passphrase for the key and allow it to be generated. I usually do at least 20 characters since the password will just sit in a script anyway. </li>
</ul>
<p>Move the keys to some other safe place so that they can't be lost. No key means the backups are worthless. Typically a second backup source is a good idea.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> cf gpg_keys.tar .gnupg<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> gpg_keys.tar</div></div>
<p>See sample scripts below for backup jobs.</p>
<hr />
<p><a name="2"></a></p>
<h2>Installation on OpenBSD 4.6</h2>
<p>First we need to add a few packages. You can use the <strong>pkg_add</strong> function with whatever mirror to obtain the following, some depend on others so there will be others in the file install list:</p>
<ul>
<li>python-2.5.4p1</li>
<li>py-xml-0.8.4p8</li>
<li>py-boto-1.7a</li>
<li>gpgme-1.1.5p0</li>
<li>librsync-0.9.7p0</li>
<li>ncftp-3.2.2 </li>
</ul>
<p>When the main Python package is installed, it will ask you to create a few symbolic links, so create those.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</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>python2.5 <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>python<br />
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</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>python2.5-config <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>python-config<br />
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-sf</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>pydoc2.5 <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>pydoc</div></div>
<p>Now we can install Duplicity.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>code.launchpad.net<span style="color: #000000; font-weight: bold;">/</span>duplicity<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.6</span>-series<span style="color: #000000; font-weight: bold;">/</span>0.6.06<span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>duplicity-0.6.06.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> duplicity-0.6.06<br />
python setup.py <span style="color: #660033;">--librsync-dir</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span> build<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #660033;">--prefix</span>=<span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">local</span></div></div>
<p>If you run the Duplicity jobs as root in a cron job, there is something about OpenBSD (I'm sure a security issue) that causes it to fail. I would get the output below in my log only when it ran as a cron job:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">Traceback (most recent call last):<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 583, in &lt;module&gt;<br />
&nbsp; &nbsp; with_tempdir(main)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 577, in with_tempdir<br />
&nbsp; &nbsp; fn()<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 558, in main<br />
&nbsp; &nbsp; full_backup(col_stats)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 234, in full_backup<br />
&nbsp; &nbsp; bytes_written = write_multivol(&quot;full&quot;, tarblock_iter, globals.backend)<br />
&nbsp; File &quot;/usr/local/bin/duplicity&quot;, line 148, in write_multivol<br />
&nbsp; &nbsp; globals.gpg_profile, globals.volsize)<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/duplicity/gpg.py&quot;, line 240, in GPGWriteFile<br />
&nbsp; &nbsp; bytes_to_go = data_size - get_current_size()<br />
&nbsp; File &quot;/usr/local/lib/python2.5/site-packages/duplicity/gpg.py&quot;, line 232, in get_current_size<br />
&nbsp; &nbsp; return os.stat(filename).st_size<br />
OSError: [Errno 2] No such file or directory:'/tmp/duplicity-gM4CN9-tempdir/mktemp-iZknw0-2'</div></div>
<p>Odd that it can't read the temporary folder that it created. Changing the folder location also did not work. The solution is to create a separate user for only backups. The can be an issue if you have files that cannot be read by all users and need backup, but I found in my case this worked for the specific files that needed to be saved.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">useradd <span style="color: #660033;">-m</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'Duplicity'</span> dpbackup<br />
usermod <span style="color: #660033;">-G</span> nogroup dpbackup<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>log</div></div>
<p>Make sure to add the new user to the deny list in SSH with <strong>DenyUsers dpbackup</strong> in the file <em>/etc/ssh/sshd_config</em>; there isn't any reason for it to log in.</p>
<p>Now su as this new user. A GPG key needs to be created so that the compressed backups can be encrypted and signed. This way no one else that may have access to our S3 account (Amazon employees) can read the data.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">su</span> dpbackup<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span><br />
$ gpg <span style="color: #660033;">--list-keys</span><br />
gpg: directory <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #ff0000;">' created<br />
gpg: new configuration file `/root/.gnupg/gpg.conf'</span> created<br />
gpg: WARNING: options <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>gpg.conf<span style="color: #ff0000;">' are not yet active during this run<br />
gpg: keyring `/root/.gnupg/pubring.gpg'</span> created<br />
gpg: <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>trustdb.gpg: trustdb created<br />
<br />
$ gpg <span style="color: #660033;">--gen-key</span></div></div>
<p>There will be a series of questions, most of the defaults are fine.</p>
<ul>
<li>Choose option 1 for DSA and Elgamal (the default)</li>
<li>Choose the default key size of 2048</li>
<li>Leave the default that the key will not expire, option 0</li>
<li>Enter a User ID, Email address, and comment for the key.</li>
<li>Type O for OK to accept.</li>
<li>Enter a long passphrase for the key and allow it to be generated. I usually do at least 20 characters since the password will just sit in a script anyway. </li>
</ul>
<p>Move the keys to some other safe place so that they can't be lost. No key means the backups are worthless. Typically a second backup source is a good idea.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> cf gpg_keys.tar .gnupg<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> gpg_keys.tar</div></div>
<p>See sample scripts below for backup jobs.</p>
<hr />
<p><a name="3"></a></p>
<h2>Installation on Debian Lenny 5.0</h2>
<p>The Debian install is a little bit simpler and can run the backup job as root inside cron. Get some install packages first:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get install</span> build-essential librsync1 librsync-dev python python-gnupginterface ncftp python-pexpect python-dev python-boto</div></div>
<p>Install Duplicity:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>code.launchpad.net<span style="color: #000000; font-weight: bold;">/</span>duplicity<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">0.6</span>-series<span style="color: #000000; font-weight: bold;">/</span>0.6.06<span style="color: #000000; font-weight: bold;">/</span>+download<span style="color: #000000; font-weight: bold;">/</span>duplicity-0.6.06.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf duplicity-0.6.06.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> duplicity-0.6.06<br />
python setup.py build<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>Creating a user is optional, but good security practice for it not to be root.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">useradd <span style="color: #660033;">-m</span> <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup <span style="color: #660033;">-c</span> <span style="color: #ff0000;">'Duplicity'</span> dpbackup<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>log</div></div>
<p>Make sure to add the new user to the deny list in SSH with <strong>DenyUsers dpbackup</strong> in the file <em>/etc/ssh/sshd_config</em>; there isn't any reason for it to log in.</p>
<p>Now su as this new user. A GPG key needs to be created so that the compressed backups can be encrypted and signed. This way no one else that may have access to our S3 account (Amazon employees) can read the data.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">su</span> dpbackup<br />
$ <span style="color: #7a0874; font-weight: bold;">cd</span><br />
$ gpg <span style="color: #660033;">--list-keys</span><br />
gpg: directory <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #ff0000;">' created<br />
gpg: new configuration file `/root/.gnupg/gpg.conf'</span> created<br />
gpg: WARNING: options <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>gpg.conf<span style="color: #ff0000;">' are not yet active during this run<br />
gpg: keyring `/root/.gnupg/pubring.gpg'</span> created<br />
gpg: <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>.gnupg<span style="color: #000000; font-weight: bold;">/</span>trustdb.gpg: trustdb created<br />
<br />
$ gpg <span style="color: #660033;">--gen-key</span></div></div>
<p>There will be a series of questions, most of the defaults are fine.</p>
<ul>
<li>Choose option 1 for DSA and Elgamal (the default)</li>
<li>Choose the default key size of 2048</li>
<li>Leave the default that the key will not expire, option 0</li>
<li>Enter a User ID, Email address, and comment for the key.</li>
<li>Type O for OK to accept.</li>
<li>Enter a long passphrase for the key and allow it to be generated. I usually do at least 20 characters since the password will just sit in a script anyway. </li>
</ul>
<p>Move the keys to some other safe place so that they can't be lost. No key means the backups are worthless. Typically a second backup source is a good idea.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">$ <span style="color: #c20cb9; font-weight: bold;">tar</span> cf gpg_keys.tar .gnupg<span style="color: #000000; font-weight: bold;">/</span><br />
$ <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> gpg_keys.tar</div></div>
<p>See sample scripts below for backup jobs.</p>
<hr />
<p><a name="4"></a></p>
<h2>Sample Backup Scripts</h2>
<p>The first portion of the script defines the variables we'll need to use. The AWS keys are defined for you when you sign up for S3.  Passphrase is the GPG passphrase set on the key generated from gpg --gen-key. The S3 bucket should be fairly unique, so I use the host name of the server. The others are pretty obvious but will be explained later.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Variables</span><br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_ACCESS_KEY_ID</span>=ABABAB3333338888WWWW<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_SECRET_ACCESS_KEY</span>=BBBBBBBBBBTTTTTTTTTT8888888888VVVVVVVVVV<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PASSPHRASE</span>=somelongpassphrase<br />
<span style="color: #007800;">DBHOST</span>=<span style="color: #ff0000;">'dbserver1'</span><br />
<span style="color: #007800;">TIMESTAMP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>M<span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #007800;">FILE_PREFIX_DB</span>=<span style="color: #ff0000;">'mydb_'</span><br />
<span style="color: #007800;">FILE_PREFIX_SVN_REPO</span>=<span style="color: #ff0000;">'repo_'</span><br />
<span style="color: #007800;">GPG_PUB_KEY</span>=<span style="color: #ff0000;">'AAEE66BB'</span><br />
<span style="color: #007800;">BACKUP_LOG_FILE</span>=<span style="color: #ff0000;">'/home/dpbackup/log/s3_backup.log'</span><br />
<span style="color: #007800;">FULL_IF_OLDER_THAN</span>=<span style="color: #ff0000;">'7D'</span><br />
<span style="color: #007800;">KEEP_MAX_SETS</span>=<span style="color: #ff0000;">'2'</span><br />
<span style="color: #007800;">S3_BUCKET</span>=<span style="color: #ff0000;">'serverhostname'</span><br />
<span style="color: #007800;">CURRENT_HOST</span>=<span style="color: #ff0000;">'server-hostname'</span><br />
<span style="color: #007800;">TO_EMAIL</span>=<span style="color: #ff0000;">'sysadmin@example.com'</span></div></div>
<p>Just some sample backup methods for MySQL or Subversion if needed.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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>mysqldump <span style="color: #660033;">-h</span> <span style="color: #007800;">$DBHOST</span> <span style="color: #660033;">-u</span> mysql_admin <span style="color: #660033;">-pmypass</span> mydb <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$FILE_PREFIX_DB</span><span style="color: #007800;">$TIMESTAMP</span>.sql<br />
<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><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> dump <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span>repo <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$FILE_PREFIX_SVN_REPO</span><span style="color: #007800;">$TIMESTAMP</span>.svnbk</div></div>
<p>This is only necessary on OpenBSD since it's a security feature. We open it up now from 128 and close it back down later.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Increase open file limit</span><br />
<span style="color: #7a0874; font-weight: bold;">ulimit</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">1024</span></div></div>
<p>Most of these options can be read in the <a href="http://duplicity.nongnu.org/duplicity.1.html">man page of Duplicity</a>, and there are many more to choose from. Basically this backup is going to do a full backup ever 7 days (from the $FULL_IF_OLDER_THAN variable), and use encryption with the highest bzip compression, before sending it to S3. It will write a fresh backup log to the defined file, which we'll email out later.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Backup to S3</span><br />
<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>duplicity <span style="color: #660033;">--s3-use-new-style</span> <span style="color: #660033;">--tempdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup <span style="color: #660033;">--full-if-older-than</span> <span style="color: #007800;">$FULL_IF_OLDER_THAN</span> <span style="color: #660033;">--encrypt-key</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$GPG_PUB_KEY</span>&quot;</span> <span style="color: #660033;">--sign-key</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$GPG_PUB_KEY</span>&quot;</span> <span style="color: #660033;">--gpg-options</span>=<span style="color: #ff0000;">'--compress-algo=bzip2 --bzip2-compress-level=9'</span> <span style="color: #660033;">--include</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apache2 <span style="color: #660033;">--include</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #660033;">--include</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>mysql <span style="color: #660033;">--exclude</span> <span style="color: #ff0000;">'**'</span> <span style="color: #000000; font-weight: bold;">/</span> s3+http:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #007800;">$S3_BUCKET</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>This line just gives us some space in the log file; really it's just for email formatting.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Separate the log file a bit</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'\n\n==== REMOVE OLD BACKUP SETS ====\n\n'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>This command will check how many full backup sets are already on S3, and remove any more than what is defined in KEEP_MAX_SETS.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Clean out backup sets older than variable sets</span><br />
<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>duplicity remove-all-but-n-full <span style="color: #007800;">$KEEP_MAX_SETS</span> s3+http:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #007800;">$S3_BUCKET</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>Again, for formatting purposes.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Separate the log file a bit</span><br />
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">'\n\n==== CURRENT FILES IN BACKUP SET &nbsp;====\n\n'</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>This command lists out the current files in our backup set so they can be reviewed in the email, making sure everything is working out it should.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># List all files in backup set for verification</span><br />
<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>duplicity list-current-files s3+http:<span style="color: #000000; font-weight: bold;">//</span><span style="color: #007800;">$S3_BUCKET</span> <span style="color: #000000; font-weight: bold;">&gt;&gt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>Now we can mail out the log file. The -s flag is for the subject line, and the TO_EMAIL is defined in our variables. We're just writing the log file as the body of the email.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Mail out log to sysadmins for verification</span><br />
mail <span style="color: #660033;">-s</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$CURRENT_HOST</span> Backup Log for <span style="color: #007800;">$TIMESTAMP</span>&quot;</span> <span style="color: #007800;">$TO_EMAIL</span> <span style="color: #000000; font-weight: bold;">&lt;</span> <span style="color: #007800;">$BACKUP_LOG_FILE</span></div></div>
<p>Since we exported the keys and passphrases, we want to make sure we don't leave those around any longer than we have to; set them null.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Clear secret variables</span><br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_ACCESS_KEY_ID</span>=<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">AWS_SECRET_ACCESS_KEY</span>=<br />
<span style="color: #7a0874; font-weight: bold;">export</span> <span style="color: #007800;">PASSPHRASE</span>=</div></div>
<p>Just a little clean up so we don't waste space.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Remove old and temporary files</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>mysql<span style="color: #000000; font-weight: bold;">/*</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>dpbackup<span style="color: #000000; font-weight: bold;">/</span>svn<span style="color: #000000; font-weight: bold;">/*</span></div></div>
<p>This is for OpenBSD only. Since we opened the open file limit up at the beginning of the script, close it back down.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Put open file limit back to default</span><br />
<span style="color: #7a0874; font-weight: bold;">ulimit</span> <span style="color: #660033;">-n</span> <span style="color: #000000;">128</span></div></div>
<p>End it.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;"># Exit</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2010/01/duplicity-install-and-backup-samples/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Slackware 13 on Lenovo T61, Trackpad and scrolling</title>
		<link>http://therosiek.com/2010/01/slackware-13-on-lenovo-t61-trackpad-and-scrolling/</link>
		<comments>http://therosiek.com/2010/01/slackware-13-on-lenovo-t61-trackpad-and-scrolling/#comments</comments>
		<pubDate>Fri, 01 Jan 2010 16:53:11 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=139</guid>
		<description><![CDATA[Out of the box the trackpad didn't scroll or have "click" capability. Just creating these two files fixed the issue. /etc/hal/fdi/policy/x11-synaptics.fdi &#60;?xml version=&#34;1.0&#34; encoding=&#34;ISO-8859-1&#34;?&#62; &#60;deviceinfo version=&#34;0.2&#34;&#62; &#160; &#60;device&#62; &#160; &#160; &#60;match key=&#34;info.capabilities&#34; contains=&#34;input.touchpad&#34;&#62; &#160; &#160; &#160; &#160; &#60;merge key=&#34;input.x11_driver&#34; type=&#34;string&#34;&#62;synaptics&#60;/merge&#62; &#160; &#160; &#160; &#160; &#60;merge key=&#34;input.x11_options.SHMConfig&#34; type=&#34;string&#34;&#62;true&#60;/merge&#62; &#160; &#160; &#160; &#160; &#60;merge key=&#34;input.x11_options.TapButton1&#34; type=&#34;string&#34;&#62;1&#60;/merge&#62; &#160; [...]]]></description>
			<content:encoded><![CDATA[<p>Out of the box the trackpad didn't scroll or have "click" capability.  Just creating these two files fixed the issue.</p>
<p><strong>/etc/hal/fdi/policy/x11-synaptics.fdi</strong></p>
<div class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;ISO-8859-1&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;deviceinfo</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;0.2&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;device<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.capabilities&quot;</span> <span style="color: #000066;">contains</span>=<span style="color: #ff0000;">&quot;input.touchpad&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_driver&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>synaptics<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.SHMConfig&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.TapButton1&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>1<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.MaxTapMove&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2000<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.VertEdgeScroll&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.HorizEdgeScroll&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; &nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/device<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/deviceinfo<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p><strong>/etc/hal/fdi/policy/mouse-wheel.fdi</strong></p>
<div class="codecolorer-container xml vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="xml codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;match</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;info.product&quot;</span> <span style="color: #000066;">string</span>=<span style="color: #ff0000;">&quot;TPPS/2 IBM TrackPoint&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.EmulateWheel&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.EmulateWheelButton&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>2<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.YAxisMapping&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>4 5<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.Emulate3Buttons&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
&nbsp; <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;merge</span> <span style="color: #000066;">key</span>=<span style="color: #ff0000;">&quot;input.x11_options.EmulateWheelTimeout&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;string&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>200<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/merge<span style="color: #000000; font-weight: bold;">&gt;</span></span></span><br />
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/match<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></div></div>
<p>Reboot and give it a try.</p>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2010/01/slackware-13-on-lenovo-t61-trackpad-and-scrolling/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>QuickBooks Enterprise Install on Debian</title>
		<link>http://therosiek.com/2009/12/quickbooks-enterprise-install-on-debian/</link>
		<comments>http://therosiek.com/2009/12/quickbooks-enterprise-install-on-debian/#comments</comments>
		<pubDate>Tue, 29 Dec 2009 19:13:50 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[QuickBooks]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=128</guid>
		<description><![CDATA[Operating System: Debian Lenny 5.0 This server needs an /opt directory for the package install, so the partitioning is a little bit different than a typical Linux setup. This is what mine ended up looking like: Filesystem Size Mounted on /dev/sda1 2G / /swap X /swap /dev/sda9 (rest) /home /dev/sda6 2G /opt /dev/sda7 1G /tmp [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Operating System:</strong> Debian Lenny 5.0</p>
<p>This server needs an /opt directory for the package install, so the partitioning is a little bit different than a typical Linux setup.  This is what mine ended up looking like:</p>
<table>
<th>Filesystem</th>
<th>Size</th>
<th>Mounted on</th>
<tr>
<td>/dev/sda1</td>
<td>2G</td>
<td>/</td>
</tr>
<tr>
<td>/swap</td>
<td>X</td>
<td>/swap</td>
</tr>
<tr>
<td>/dev/sda9</td>
<td>(rest)</td>
<td>/home</td>
</tr>
<tr>
<td>/dev/sda6</td>
<td>2G</td>
<td>/opt</td>
</tr>
<tr>
<td>/dev/sda7</td>
<td>1G</td>
<td>/tmp</td>
</tr>
<tr>
<td>/dev/sda5</td>
<td>3G</td>
<td>/usr</td>
</tr>
<tr>
<td>/dev/sda8</td>
<td>2G</td>
<td>/var</td>
</tr>
</table>
<p>Setup a few packages necessary for the server first.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">apt-get install</span> samba gamin alien</div></div>
<p>Now users and groups need to be added for permissions and the Samba folder share access.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">groupadd quickbooks<br />
useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user1 <span style="color: #660033;">-g</span> quickbooks user1<br />
useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user2 <span style="color: #660033;">-g</span> quickbooks user2<br />
useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user3 <span style="color: #660033;">-g</span> quickbooks user3<br />
useradd <span style="color: #660033;">-d</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>user4 <span style="color: #660033;">-g</span> quickbooks user4<br />
smbpasswd <span style="color: #660033;">-a</span> user1<br />
smbpasswd <span style="color: #660033;">-a</span> user2<br />
smbpasswd <span style="color: #660033;">-a</span> user3<br />
smbpasswd <span style="color: #660033;">-a</span> user4</div></div>
<p>Create the folder where the QuickBooks data files will be stored and set the appropriate permissions.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>qbdata<br />
<span style="color: #c20cb9; font-weight: bold;">chown</span> user1:quickbooks <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>qbdata<span style="color: #000000; font-weight: bold;">/</span><br />
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">775</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>qbdata<span style="color: #000000; font-weight: bold;">/</span></div></div>
<p>Now configure Samba by moving the built in configuration and writing your own.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>samba<br />
<span style="color: #c20cb9; font-weight: bold;">mv</span> smb.conf smb.conf.orig<br />
<span style="color: #c20cb9; font-weight: bold;">cp</span> smb.conf.orig smb.conf<br />
<span style="color: #c20cb9; font-weight: bold;">vi</span> smb.conf</div></div>
<p>The configuration file should read:</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">[global]<br />
&nbsp; &nbsp;workgroup = WORKGROUP<br />
&nbsp; &nbsp;server string = %h server<br />
&nbsp; &nbsp;dns proxy = no<br />
&nbsp; &nbsp;log file = /var/log/samba/log.%m<br />
&nbsp; &nbsp;max log size = 1000<br />
&nbsp; &nbsp;syslog = 0<br />
&nbsp; &nbsp;panic action = /usr/share/samba/panic-action %d<br />
&nbsp; &nbsp;encrypt passwords = true<br />
&nbsp; &nbsp;passdb backend = tdbsam<br />
&nbsp; &nbsp;obey pam restrictions = yes<br />
&nbsp; &nbsp;unix password sync = yes<br />
&nbsp; &nbsp;passwd program = /usr/bin/passwd %u<br />
&nbsp; &nbsp;passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .<br />
&nbsp; &nbsp;pam password change = yes<br />
<br />
[qbdata]<br />
&nbsp; &nbsp;path = /home/qbdata<br />
&nbsp; &nbsp;comment = Quickbooks Enterprise database share<br />
&nbsp; &nbsp;valid users = user1,user2,user3,user4<br />
&nbsp; &nbsp;public = no<br />
&nbsp; &nbsp;writeable = yes<br />
&nbsp; &nbsp;printable = no<br />
&nbsp; &nbsp;create mask = 0765</div></div>
<p>Now restart Samba and test the permissions using a Windows client. You should be able to see the logs created by each client and who was accessing the share.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>samba restart<br />
<span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>log.smbd<br />
<span style="color: #c20cb9; font-weight: bold;">tail</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>samba<span style="color: #000000; font-weight: bold;">/</span>log.rst-win-utl3</div></div>
<p>Using Alien, we'll create a deb package from an rpm so it can be installed. Some other directories and files need to be created for logging purposes since Debian uses rsyslog and QuickBooks won't create them on its own.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>http-download.intuit.com<span style="color: #000000; font-weight: bold;">/</span>http.intuit<span style="color: #000000; font-weight: bold;">/</span>CMO<span style="color: #000000; font-weight: bold;">/</span>qbes<span style="color: #000000; font-weight: bold;">/</span>resources<span style="color: #000000; font-weight: bold;">/</span>qbdbm-<span style="color: #000000;">20.0</span>-<span style="color: #000000;">5</span>.i386.rpm<br />
alien qbdbm-<span style="color: #000000;">20.0</span>-<span style="color: #000000;">5</span>.i386.rpm<br />
<span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<br />
<span style="color: #c20cb9; font-weight: bold;">dpkg</span> <span style="color: #660033;">-i</span> qbdbm_20.0-<span style="color: #000000;">6</span>_i386.deb<br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>qbdbfilemon.log<br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>log<span style="color: #000000; font-weight: bold;">/</span>qbdbmgrn_20.log<br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<span style="color: #000000; font-weight: bold;">/</span>qbdbfilemon<br />
<span style="color: #c20cb9; font-weight: bold;">touch</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lock<span style="color: #000000; font-weight: bold;">/</span>subsys<span style="color: #000000; font-weight: bold;">/</span>qbdbmgrn_20</div></div>
<p>We need to add a line to the syslog configuration in <strong>/etc/rsyslog.conf</strong>, just put it at the end.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">daemon.* &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;-/var/log/qbdbfilemon.log</div></div>
<p>Setup the QuickBooks binaries to startup automatically.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">update-rc.d qbdbfilemon defaults<br />
update-rc.d qbdbmgrn_20 defaults</div></div>
<p>Modify the file <strong>/opt/qb/util/qbmonitord.conf</strong> in include the directory where the QuickBooks data will live.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">/home/qbdata</div></div>
<p>Restart the server and you should be able to run a <strong>ps -e</strong> and see the following processes running indicating the server is up. There also should be a <strong>/home/qbdata/qbdir.dat</strong> file created automatically.</p>
<div class="codecolorer-container text vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">&nbsp;1987 ? &nbsp; &nbsp; &nbsp; &nbsp;00:00:01 qbmonitord<br />
&nbsp;1994 ? &nbsp; &nbsp; &nbsp; &nbsp;00:00:02 gam_server<br />
&nbsp;1995 ? &nbsp; &nbsp; &nbsp; &nbsp;00:25:40 QBDBMgrN_20</div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2009/12/quickbooks-enterprise-install-on-debian/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
<enclosure url="http://http-download.intuit.com/http.intuit/CMO/qbes/resources/qbdbm-20.0-5.i386.rpm" length="7959629" type="audio/x-pn-realaudio-plugin" />
		</item>
		<item>
		<title>Slackware 13 on Lenovo T61, Intel Wireless 4965</title>
		<link>http://therosiek.com/2009/12/slackware-13-on-lenovo-t61-intel-wireless-4965/</link>
		<comments>http://therosiek.com/2009/12/slackware-13-on-lenovo-t61-intel-wireless-4965/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 18:29:14 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Slackware]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=113</guid>
		<description><![CDATA[I had some trouble getting the wireless to function properly on my T61 with Slackware 13. I tried combinations of wicd (the wireless network manager) and DHCP clients, different drivers, but nothing seemed to work. I could see the wireless points, but they always showed up as "hidden" and appear to connect, but would dever [...]]]></description>
			<content:encoded><![CDATA[<p>I had some trouble getting the wireless to function properly on my T61 with Slackware 13.  I tried combinations of wicd (the wireless network manager) and DHCP clients, different drivers, but nothing seemed to work.  I could see the wireless points, but they always showed up as "hidden" and appear to connect, but would dever be able to get an IP address.</p>
<p>At this point I moved to Debian to see if that would connect using wicd.  Sure enough, wicd connected and authenticated fine, but a kernel panic in Lenny using that wireless adapter would only leave it connected for about 5 minutes and then lock.  Enough of that.</p>
<p>Back to Slackware.  One thing I noticed was that Debian used the latest wicd, version 1.6.2.2 where the Slackware <em>extras</em> includes the 1.6.2.1 Slackware package.  Even the wicd site recommends using the included package in the <em>extras</em>.</p>
<p>Slackware also came with the same firmware for the 4965 wireless as Debian, so I know if I used that, I should be good to go on that end.  First, enable the firmware as root:</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">modprobe iwl4965</div></div>
<p>Restart your computer and make sure the wireless adapter is loading properly on boot.  You should be able to do an <strong>lsmod | grep iwlagn</strong> and see a few lines with the module enabled.  Now grab wicd 1.6.2.2 from source; you can view them here: http://sourceforge.net/projects/wicd/files/.  Unpack it and install wicd.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><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<br />
<span style="color: #c20cb9; font-weight: bold;">wget</span> http:<span style="color: #000000; font-weight: bold;">//</span>sourceurl<span style="color: #000000; font-weight: bold;">/</span>wicd-1.6.2.2.tar.gz<br />
<span style="color: #c20cb9; font-weight: bold;">tar</span> zxvf wicd-1.6.2.2.tar.gz<br />
<span style="color: #7a0874; font-weight: bold;">cd</span> wicd-1.6.2.2<br />
python setup.py configure<br />
python setup.py <span style="color: #c20cb9; font-weight: bold;">install</span></div></div>
<p>You can check <strong>/etc/rc.d</strong> and find a <em>rc.wicd</em> executable.  This means the daemon should start on it's own when booting.  Start the wicd daemon and then the curses version of the client.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">wicd<br />
wicd-curses</div></div>
<p>The curses GUI is pretty easy to understand and you should be able to configure the network no problem.  When you hit Shift+C to connect to an AP, you can see that it will authenticate and grab an IP this time...finally.  I've been able to connect to WPAv2 and WPAv1.  Previously I could connect to neither, although I never tried plain old WEP.  Others clamined WEP would work and WPA would not, but not being able to connect to a WPA network was a big show stopper for me.</p>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2009/12/slackware-13-on-lenovo-t61-intel-wireless-4965/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Backing up Subversion to FTP</title>
		<link>http://therosiek.com/2009/10/backing-up-subversion-to-ftp/</link>
		<comments>http://therosiek.com/2009/10/backing-up-subversion-to-ftp/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 17:28:07 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[Tech Notes]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Subversion]]></category>

		<guid isPermaLink="false">http://therosiek.com/?p=107</guid>
		<description><![CDATA[Handy little script for backing up Subversion to an FTP server. #!/bin/sh # Variables HOST='server.local.com' USER='unixbackup' PASSWD='mypass' TIMESTAMP=`date +%m%d%Y%H%M` FILEPRE='egsvn_' # Backup EG repository /usr/local/bin/svnadmin dump /usr/home/svn &#62; /home/me/svn_backups/$FILEPRE$TIMESTAMP # FTP backup to tape server cd /home/me/svn_backups ftp -n $HOST &#62; /tmp/ftp.worked 2&#62; /tmp/ftp.failed &#60;&#60;END_SCRIPT quote USER $USER quote PASS $PASSWD binary put $FILEPRE$TIMESTAMP quit [...]]]></description>
			<content:encoded><![CDATA[<p>Handy little script for backing up Subversion to an FTP server.</p>
<div class="codecolorer-container bash vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666; font-style: italic;">#!/bin/sh</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Variables</span><br />
<br />
<span style="color: #007800;">HOST</span>=<span style="color: #ff0000;">'server.local.com'</span><br />
<span style="color: #007800;">USER</span>=<span style="color: #ff0000;">'unixbackup'</span><br />
<span style="color: #007800;">PASSWD</span>=<span style="color: #ff0000;">'mypass'</span><br />
<span style="color: #007800;">TIMESTAMP</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">date</span> +<span style="color: #000000; font-weight: bold;">%</span>m<span style="color: #000000; font-weight: bold;">%</span>d<span style="color: #000000; font-weight: bold;">%</span>Y<span style="color: #000000; font-weight: bold;">%</span>H<span style="color: #000000; font-weight: bold;">%</span>M<span style="color: #000000; font-weight: bold;">`</span><br />
<span style="color: #007800;">FILEPRE</span>=<span style="color: #ff0000;">'egsvn_'</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Backup EG repository</span><br />
<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><span style="color: #c20cb9; font-weight: bold;">svnadmin</span> dump <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span><span style="color: #c20cb9; font-weight: bold;">svn</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>me<span style="color: #000000; font-weight: bold;">/</span>svn_backups<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$FILEPRE</span><span style="color: #007800;">$TIMESTAMP</span><br />
<br />
<span style="color: #666666; font-style: italic;"># FTP backup to tape server</span><br />
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>me<span style="color: #000000; font-weight: bold;">/</span>svn_backups<br />
<span style="color: #c20cb9; font-weight: bold;">ftp</span> <span style="color: #660033;">-n</span> <span style="color: #007800;">$HOST</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ftp.worked <span style="color: #000000;">2</span><span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span>ftp.failed<br />
<span style="color: #000000; font-weight: bold;">&lt;&lt;</span>END_SCRIPT<br />
quote USER <span style="color: #007800;">$USER</span><br />
quote PASS <span style="color: #007800;">$PASSWD</span><br />
binary<br />
put <span style="color: #007800;">$FILEPRE</span><span style="color: #007800;">$TIMESTAMP</span><br />
quit<br />
END_SCRIPT<br />
<br />
<span style="color: #666666; font-style: italic;"># Remove old files</span><br />
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>home<span style="color: #000000; font-weight: bold;">/</span>me<span style="color: #000000; font-weight: bold;">/</span>svn_backups<span style="color: #000000; font-weight: bold;">/*</span><br />
<br />
<span style="color: #666666; font-style: italic;"># Exit</span><br />
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></div></div>
]]></content:encoded>
			<wfw:commentRss>http://therosiek.com/2009/10/backing-up-subversion-to-ftp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

