<?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>My Galagzee! &#187; UNIX</title>
	<atom:link href="http://my.galagzee.com/category/technical/unix-technical/feed/" rel="self" type="application/rss+xml" />
	<link>http://my.galagzee.com</link>
	<description>Tech in a Galagzee, Not So Far Away.</description>
	<lastBuildDate>Wed, 28 Jul 2010 17:09:34 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Mounting an NFS share after boot, and checking up on it periodically&#8230;</title>
		<link>http://my.galagzee.com/2010/07/23/mounting-nfs-share-after-boot-and-checking-up-on-it-periodically/</link>
		<comments>http://my.galagzee.com/2010/07/23/mounting-nfs-share-after-boot-and-checking-up-on-it-periodically/#comments</comments>
		<pubDate>Fri, 23 Jul 2010 19:20:51 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Networking]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[circular]]></category>
		<category><![CDATA[nfs]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=433</guid>
		<description><![CDATA[I needed to automatically mount an NFS share after reboot. But the availability of that share could not be guaranteed &#8211; the system on the LAN offering the share might be down for maintenance when the system mounting the share is being rebooted. In such case there would be a lengthy wait during the boot]]></description>
			<content:encoded><![CDATA[<p>I needed to automatically mount an NFS share after reboot. But the availability of that share could not be guaranteed &#8211; the system on the LAN offering the share might be down for maintenance when the system mounting the share is being rebooted. In such case there would be a lengthy wait during the boot sequence until the mount attempt would time out.</p>
<p>So I wrote a short script to handle the situation. <del datetime="2010-07-28T17:01:44+00:00">When initialized at boot time through init.d or rc.d, it&#8217;ll first attempt to mount the share, but then times out in two seconds (this is a LAN NFS share so if the system offering the share is up there should not be a longer delay than that) and so the boot sequence is not slowed down terribly.</del> (see update below) Once boot is complete, the script is run via cron every five minutes. Depending on the criticality of the share you may want to make that time shorter or longer. In this case it is a backup share which is not critical for the system&#8217;s functioning.</p>
<p>This technique would handle circular mounts, too, but obviously you would run into trouble if the mounts are required for successful system boot.</p>
<p>For this to work successfully add a marker file, such as &#8220;.myremoteservertransfers&#8221; in my example script below, in the share folder on the system exporting the share. I usually set the undeletable attribute on the file to make sure it doesn&#8217;t get accidentally deleted.</p>
<p><B>Update:</b> Even with this code the boot sequence appears to hang until portmap times out (which takes quite a while) if the NFS share is not available at boot time. I removed the rc.d mount attempt and just shortened the cron poll period to 1 minute. That way the share will be up very quickly once it becomes available, yet the overhead caused by the periodic ping is minimal (both servers are on local LAN).</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li>#!/bin/sh</li><li>&nbsp;</li><li>SHELL=/bin/sh</li><li>PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin</li><li>&nbsp;</li><li># remote system name</li><li>remotesystem=myremoteserver</li><li>&nbsp;</li><li># remote share name</li><li>remoteshare=/nfsexports/backupshare</li><li>&nbsp;</li><li># local mount point</li><li>mountpoint=/localbackups/TRANSFERS/$<span class="br0">&#123;</span>myremoteserver<span class="br0">&#125;</span></li><li>&nbsp;</li><li># file to indicate local mount status</li><li>testfile=$mountpoint/.myremoteservertransfers</li><li>&nbsp;</li><li># --- end variables ---</li><li>&nbsp;</li><li># ping result to the remote system <span class="br0">&#40;</span>2 sec timeout<span class="br0">&#41;</span>; not empty is OK</li><li>remoteping=`ping -c1 -o -q -t2 $<span class="br0">&#123;</span>remotesystem<span class="br0">&#125;</span> | grep &quot; 0.0%&quot;`</li><li>&nbsp;</li><li>if <span class="br0">&#91;</span> &quot;$<span class="br0">&#123;</span>remoteping<span class="br0">&#125;</span>&quot; != &quot;&quot; <span class="br0">&#93;</span> ; then</li><li>&nbsp;</li><li>&nbsp;&nbsp; # server is available so query availability of the remote share; not empty is OK</li><li>&nbsp;&nbsp; offsiteshare=`showmount -e $<span class="br0">&#123;</span>remotesystem<span class="br0">&#125;</span> | grep &quot;$<span class="br0">&#123;</span>remoteshare<span class="br0">&#125;</span>&quot;`</li><li>&nbsp;</li><li>&nbsp;&nbsp; if <span class="br0">&#91;</span> &quot;$<span class="br0">&#123;</span>offsiteshare<span class="br0">&#125;</span>&quot; != &quot;&quot; <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span class="br0">&#91;</span> ! -e $<span class="br0">&#123;</span>testfile<span class="br0">&#125;</span> <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; mount -r -t nfs $<span class="br0">&#123;</span>remotesystem<span class="br0">&#125;</span>:$<span class="br0">&#123;</span>remoteshare<span class="br0">&#125;</span> $<span class="br0">&#123;</span>mountpoint<span class="br0">&#125;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi</li><li>&nbsp;&nbsp; fi</li><li>fi</li><li>&nbsp;</li><li>exit <span style="">0</span></li></ol></div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2010/07/23/mounting-nfs-share-after-boot-and-checking-up-on-it-periodically/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Caching inbound email on LAN with Postfix (and restricting reception of external mail only to the external mail provider)</title>
		<link>http://my.galagzee.com/2010/07/10/caching-inbound-email-on-lan-with-postfix/</link>
		<comments>http://my.galagzee.com/2010/07/10/caching-inbound-email-on-lan-with-postfix/#comments</comments>
		<pubDate>Sat, 10 Jul 2010 20:41:15 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Mail]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[caching]]></category>
		<category><![CDATA[mail]]></category>
		<category><![CDATA[postfix]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=414</guid>
		<description><![CDATA[Externalizing email reception often offers many benefits: firstly, it&#8217;s [more] worry-free than servicing email internally, especially in smaller organizations where there may not be an email administrator on-call 24/7. Or, think of a situation where there is an &#8220;IT guy&#8221; who manages internal email. Then he goes on a vacation and email goes down. Now]]></description>
			<content:encoded><![CDATA[<p>Externalizing email reception often offers many benefits: firstly, it&#8217;s [more] worry-free than servicing email internally, especially in smaller organizations where there may not be an email administrator on-call 24/7. Or, think of a situation where there is an &#8220;IT guy&#8221; who manages internal email. Then he goes on a vacation and email goes down. Now what? And even when the IT guy is present, the budget may not allow for good redundancy for email reception. What if the email server melts down. Perhaps there is a backup plan but without a stand-by server and/or perhaps virtualization option getting mail reception back online could take a day, which potentially would be a big hindrance to business.</p>
<p>However, outsourced email is not without its pitfalls, too. Even with a reasonably fast network connection there is more noticeable latency when accessing a remote email server as opposed to a LAN-based solution. Then there is the issue of outsourced service quality vs. the cost. Some services like Fusemail or Rackspace offer <em>reasonable</em> quality and fairly customizable features. But when something does go wrong you&#8217;re dependent on their response time. You&#8217;ve essentially handed away control of your email reception, for better or for worse. </p>
<p>Mostly, however, reception uptime is good with most well-run outsourced mail services, and the issues that more commonly crop up are related to latency and in some cases (like with Fusemail from time to time) apparent capacity issues. And if you access Fusemail with Outlook 2010&#8242;s IMAP client, you may have noticed frequent spontaneously changing message ID&#8217;s which repeatedly pop up a notification on Outlook.</p>
<p>The client-side issues are easy to remedy by caching inbound email on your local server. It gives you the best of both worlds: quick access to email <em>and</em> safety of someone monitoring mail reception 24/7 with multiple redundancies. If your local caching mail server goes down even for an extended amount of time, all you need to do is to repoint your clients to the external provider&#8217;s IMAP or POP server and you&#8217;re back in business. You may also opt to use your own outbound SMTP service (assuming you have a static IP in use) which makes it possible to isolate your domains&#8217; SPF records to the IPs you own (as opposed to allowing anyone with an account, for example, at Fusemail to spoof mail from your domains without an SPF penalty). And if you use Fusemail, your own SMTP server will give you a peace of mind so that your outbound emails won&#8217;t trigger suspension of your account like happened to me soon after I first signed up with them (see <em><a href="http://my.galagzee.com/2009/05/03/fusemail-auto-suspends/">Fusemail auto-suspends spam-suspect accounts!</a></em>). Perhaps they&#8217;ve fixed that issue since then.</p>
<p>Setting up a caching mail service on your LAN is fairly easy with Postfix. The following tutorial assumes you already have a functioning Postfix/Dovecot setup where you&#8217;re able to send and receive email based on your requirements.</p>
<p>To start with, configure and test local users that you would like to correspond to outsourced email service&#8217;s mailboxes. They do not need to have the same login name, and you can also consolidate multiple external accounts to one local account. In smaller setups it&#8217;s  the easiest to simply create a flat-file for user Dovecot passwords lookups.</p>
<p>Assuming you like to receive all email through an outsourced service (which, if you use an outsourced service, is the preferred option), you will want to restrict mail reception from the outside world only to the sending mail servers of the external mail provider of your choice. To accomplish this some restrictions are added to the local cache server&#8217;s main.cf file. The following is the configuration I use; I&#8217;ve carefully given thought of the restrictions not being too constrictive as to unnecessarily prevent connections, but on the other hand cut off connections that would not result in a successful or desired mail transit.</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li></li><li>smtpd_helo_restrictions =</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permit_mynetworks</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_invalid_helo_hostname</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permit_sasl_authenticated</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_non_fqdn_helo_hostname</li><li>&nbsp;</li><li>smtpd_client_restrictions =</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permit_mynetworks</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permit_sasl_authenticated</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_client_access hash:$config_directory/tables/smtpd_client_access</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_client_access cidr:$config_directory/tables/smtpd_client_access.cidr</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject</li><li>&nbsp;</li><li>smtpd_etrn_restrictions =</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permit_mynetworks</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject</li><li>&nbsp;</li><li>smtpd_sender_restrictions =</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_non_fqdn_sender</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_unknown_sender_domain</li><li>&nbsp;</li><li>smtpd_recipient_restrictions =</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_non_fqdn_recipient</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_unknown_recipient_domain</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permit_mynetworks</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_unlisted_recipient</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;permit_sasl_authenticated</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_recipient_access hash:$config_directory/tables/smtpd_recipient_access</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#the following also permits mynetworks!</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_recipient_access pcre:$config_directory/tables/smtpd_recipient_access.pcre</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_unauth_destination</li><li>&nbsp;</li><li>smtpd_data_restrictions =</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_multi_recipient_bounce</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;reject_unauth_pipelining</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>You will notice external hash and PCRE lookup tables &#8220;smtpd_client_access&#8221;, &#8220;smtpd_client_access.cidr&#8221;, &#8220;smtpd_recipient_access&#8221;, and &#8220;smtpd_recipient_access.pcre&#8221;. Let&#8217;s look at them next.</p>
<p>smtpd_client_access (hash) and smtpd_client_access.cidr (example below) list the external IP addresses you allow to connect and hence relay mail to your cache server. If the external IPs are not on this list, the connection is terminated.</p>
<p>Here&#8217;s an example smtpd_client_access (hash, so it&#8217;s converted to smtpd_client_access.db with postmap):<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li></li><li># some individual external server I want to allow to connect</li><li>100.200.100.200 PERMIT</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>And here&#8217;s an example smtpd_client_access.cidr:<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li></li><li>1.2.3.4/<span style="">24</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OK</li><li>10.20.30.40&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OK</li><li>100.200.201.0/<span style="">21</span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OK</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>While the sending servers of an outsourced service don&#8217;t change often, they <em>may</em> change at any time without a warning. Thus maintaining the above list manually would be a frustrating task. To automate the process, you can cull this information from the outsourced mail service&#8217;s SPF records with a cron-scheduled shell script (note that paths relate to FreeBSD; if you run Linux, adjust them to the taste/requirements):</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li></li><li>#!/bin/sh</li><li>&nbsp;</li><li>ORIGINAL=/usr/local/etc/postfix/tables/smtpd_client_access.cidr</li><li>NEW=/tmp/postfix_clients.tmp</li><li>&nbsp;</li><li>dig +short fusemail.net TXT | grep 'v=spf1' | egrep -o 'ip4:<span class="br0">&#91;</span>0-9./<span class="br0">&#93;</span>+' | sed 's/^ip4://' | sed 's/$/&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;OK/' &gt; $NEW</li><li>&nbsp;</li><li>ORIGINAL_CK=`cksum $ORIGINAL | awk '<span class="br0">&#123;</span>print $1<span class="br0">&#125;</span>'`</li><li>NEW_CK=`cksum $NEW | awk '<span class="br0">&#123;</span>print $1<span class="br0">&#125;</span>'`</li><li>&nbsp;</li><li>if <span class="br0">&#91;</span> -s $NEW <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;if <span class="br0">&#91;</span> $ORIGINAL_CK != $NEW_CK <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;cp -f $NEW $ORIGINAL</li><li>&nbsp;&nbsp;&nbsp;&nbsp;postfix reload &gt; /dev/null <span style="">2</span>&gt;&amp;<span style="">1</span></li><li>&nbsp;&nbsp;fi</li><li>fi</li><li>&nbsp;</li><li>rm $NEW</li><li>&nbsp;</li><li>exit <span style="">0</span></li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>The above example is obviously for Fusemail, but you can modify it for other providers simply by replacing the provider domain name on the dig line.</p>
<p>In my configuration smtpd_recipient_access (hash) lists simply the nullroute that is often required – such as in php.ini mail configuration where you might put:</p>
<p>sendmail_path = /usr/sbin/sendmail -t -i -f <strong>nullroute@mydomain.com</strong></p>
<p>So in smtpd_recipient_access (hash) I list:<br />
<!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li></li><li>nullroute@mydomain.com&nbsp;&nbsp;PERMIT</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Meanwhile, smtpd_recipient_access.pcre lists the users who&#8217;re allowed to receive mail externally, from the IPs you defined with smtpd_client_access/smtpd_client_access.pcre:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li></li><li>if !/^<span class="br0">&#40;</span>nullroute|abuse|postmaster|user1|user2|user3<span class="br0">&#41;</span>@mydomain\.com$/</li><li>/^/ internal</li><li>endif</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>Again, the above is sufficient for small configurations, but if you have dozens or more users whose external email you&#8217;re caching you may be better off storing the client_access table on a database server.</p>
<p>Finally, as you notice the &#8216;internal&#8217; keyword being added above to user addresses that are not matched by smtpd_client_access.pcre, you want to add the following in main.cf:</p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li></li><li>smtpd_restriction_classes = internal, public</li><li>internal = permit_mynetworks, reject</li><li>public = permit</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
<p>With these in place you will now receive email only from your external mail provider (and perhaps some other authorized servers if you defined one with smtpd_client_access hash table). This is important because you&#8217;re likely using your outsourced mail provider&#8217;s spam filtering, and you don&#8217;t want spammers contacting your cache mail server directly.</p>
<p>With the local server configured (and hopefully sufficiently tested <img src='http://my.galagzee.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  ) you can then go ahead and create mail forwarding rules at the external provider of your choice. You would simply copy any arrived email to the corresponding email address at your local cache server. I have additionally created a rule at the external provider which prunes the mailbox after given number of time since the users will not go through and delete read email there.</p>
<p>You may want to allow authenticated client access to your local users so that they can access their email via IMAP or POP remotely, and perhaps over the web (like via locally installed Squirrelmail). It is also a consideration that the email at the external provider will not be synced back – if users delete email from their locally cached mailbox it will not be deleted from the mailbox at the external provider, so under normal circumstances your cached email server should be the only access point for mail. But in an event of the server melt-down it is a minor inconvenience that the external provider&#8217;s mailbox would have older emails (that perhaps were deleted locally) in it – at least the users can continue to access email while you&#8217;re getting the caching server back online!</p>
<p>** NOTE: I&#8217;m using the current GA/Stable version of Postfix (2.7.0). If you&#8217;re using an older version, double-check that the configuration options I propose above are available before using them! This is one reason for why I prefer to use FreeBSD for mail; the ports version of Postfix is kept well up-to-date while CentOS/RHEL Postfix package is — as you would expect from an Enterprise Linux — currently at 2.3.3. You could compile it yourself, I suppose, but I&#8217;m not up to the task since I&#8217;m not a full-time Postfix admin.</p>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2010/07/10/caching-inbound-email-on-lan-with-postfix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Things I didn&#8217;t know about ESXi</title>
		<link>http://my.galagzee.com/2010/06/06/vmware-n00b-%e2%80%93-things-i-didnt-know-about-esxi/</link>
		<comments>http://my.galagzee.com/2010/06/06/vmware-n00b-%e2%80%93-things-i-didnt-know-about-esxi/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 04:11:25 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[Virtualization]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[esxi]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[virtual]]></category>
		<category><![CDATA[vmware]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=408</guid>
		<description><![CDATA[I&#8217;m setting up a development server using vmware ESXi virtual server running CentOS 5.5 x64 and FreeBSD 8.0 x64. Currently, the second installation pass is in progress. Being fresh to ESX/ESXi there were couple of things I didn&#8217;t realize: First (the reason for the reinstall), if there is plenty of hard drive space available, it&#8217;s]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m setting up a development server using vmware ESXi virtual server running CentOS 5.5 x64 and FreeBSD 8.0 x64. Currently, the second installation pass is in progress. Being fresh to ESX/ESXi there were couple of things I didn&#8217;t realize:</p>
<p>First (the reason for the reinstall), if there is plenty of hard drive space available, it&#8217;s good idea not to deplete it all for the sytem installations. I split a 1.3Tb RAID 5 array between the two operating systems until I realized that 1) you can&#8217;t shrink vmfs partitions and 2) by consuming all hard drive space one limits the flexibility of the system down the line. Let&#8217;s say you want to install a newer version of an operating system and decide to do a fresh install. You need space for it while you want to keep the old version around at least long enough to migrate settings and data over.</p>
<p>Second, while I was aware of that ESXi doesn&#8217;t offer console access beyond the &#8220;yellow and grey&#8221; terminal, I didn&#8217;t realize you have no access to the VM consoles, either. So, with CentOS or FreeBSD installed, the only way to access their consoles is via the vSphere client (someone correct me if I&#8217;m wrong — I wish I were as I&#8217;d like to have local console access to the guest OS&#8217;es).</p>
<p>Finally, <a href="https://go.vmware.com/">VMware Go</a> &#8220;doesn&#8217;t currently support ESXi servers with multiple datastores&#8221;. So if you have, say, a 3ware/LSI/AMCC RAID controller which isn&#8217;t currently supported under ESXi as a boot device but which you likely still want to use as a datastore, you&#8217;ll end up with at least two datastores. So vSphere is really the only way to go for VM management also for this reason (since LSI provides a vmware-specific driver, one may also be able to direct-connect the LSI RAID array to the VM without it being an ESXi datastore, but that&#8217;s not the configuration I&#8217;m looking for—the boot device is small and houses just ESXi while the VMs and their associated datastores are located on the array).</p>
<p>In the end everything&#8217;s working quite well. I like the flexibility virtualization offers.. and consolidation is useful even in a small environment (one dev machine is less than two or three dev machines <img src='http://my.galagzee.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ).</p>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2010/06/06/vmware-n00b-%e2%80%93-things-i-didnt-know-about-esxi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Explorations in the World of Linux</title>
		<link>http://my.galagzee.com/2009/09/05/explorations-in-the-world-of-linux/</link>
		<comments>http://my.galagzee.com/2009/09/05/explorations-in-the-world-of-linux/#comments</comments>
		<pubDate>Sun, 06 Sep 2009 03:55:02 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[bsd]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=375</guid>
		<description><![CDATA[I&#8217;ve been a FreeBSD admin for the past decade, and during this time have become quite familiar with the *BSD system. It has its quirks, but overall it&#8217;s very clean and easy to maintain. From time to time – usually when I&#8217;ve been getting ready to upgrade to the next major revision of FreeBSD –]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been a FreeBSD admin for the past decade, and during this time have become quite familiar with the *BSD system. It has its quirks, but overall it&#8217;s very clean and easy to maintain. </p>
<p>From time to time – usually when I&#8217;ve been getting ready to upgrade to the next major revision of FreeBSD – I&#8217;ve taken some time to research what the current pros and cons are for FreeBSD vs. some Linux distro. Always, in the end, FreeBSD has won.  However, a development project I&#8217;m starting to work on will utilize <a href="http://www.zend.com/en/products/server/" target="_blank">Zend Server</a>, which is only supported on handful of common Linux distros and on Windows (which is, by default, not an option as I strongly maintain that Windows is not suitable as a web server platform). There is, of course, Linux compatibility layer in FreeBSD, but as Zend doesn&#8217;t currently support it as a platform for Zend Server, I wouldn&#8217;t feel comfortable using it in a production environment.</p>
<p>So even though I find FreeBSD superior to Linux in many ways, I&#8217;ve now spent some time getting acquainted with Linux. I first started with Red Hat, then moved to CentOS which is the Linux distribution I&#8217;m currently testing. Now it&#8217;s not <em>bad</em>, per se, but I frequently come back to the thought: &#8220;Why would someone, anyone prefer THIS over a BSD system?!&#8221;  The package management with yum, rpm, and the GUI overlays is easy enough, but <em>it&#8217;s chaotic!</em> Having to enable and disable repos, set their priorities, etc. seems unnecessarily complicated. On the FreeBSD side there is the <a href="http://en.wikipedia.org/wiki/Ports_collection" target="_blank">ports collection</a> which provides most of the software that one can imagine ever needing.  The odd few items that either aren&#8217;t available in ports, or whose configuration is somehow not complete enough through ports can be easily compiled from the source tarball. Everything&#8217;s quite easy to keep track of, and to duplicate if one&#8217;s building a new system.</p>
<p>I&#8217;m sure some of this feeling stems from the fact that I have been using a BSD system for so long, and from the fact that I probably don&#8217;t yet know Linux well enough (say, to build the system from a scratch..). But as far as I can tell, package management <em>is</em> done with yum and rpm (on CentOS, say), by adjusting repository priorities, and enabling/disabling repositories. That is messy!</p>
<p>Well, I now have a functional development server running Zend Server with Apache, Subversion, and MySQL, and as the vendor (Zend) dictates the rules, I must continue development on Linux. Perhaps in six months time I&#8217;ll have more favorable comments about it as compared to FreeBSD&#8230; but I sort of doubt it.  My guess is I&#8217;ll just learn to live with it, every now and then wistfully glancing to the direction of the BSD server.</p>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2009/09/05/explorations-in-the-world-of-linux/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Unix Commands Galore</title>
		<link>http://my.galagzee.com/2009/08/04/unix-commands-galore/</link>
		<comments>http://my.galagzee.com/2009/08/04/unix-commands-galore/#comments</comments>
		<pubDate>Wed, 05 Aug 2009 04:48:26 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[commands]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=336</guid>
		<description><![CDATA[Couple of days ago a friend of mine pointed me to commandlinefu.com. It&#8217;s strange how addictive a service like that can be! I&#8217;ve perused a good chunk of the commands posted on the site, learned quite a few new things, augmented the command aliases on my servers, and posted few of my brainchildren as well]]></description>
			<content:encoded><![CDATA[<p>Couple of days ago a friend of mine pointed me to <a href="http://www.commandlinefu.com/" target="_blank">commandlinefu.com</a>.  It&#8217;s strange how addictive a service like that can be! I&#8217;ve perused a good chunk of the commands posted on the site, learned quite a few new things, augmented the command aliases on my servers, and <a href="http://www.commandlinefu.com/commands/by/vwal"  target="_blank">posted few of my brainchildren</a> as well as posted suggested fixes to some that I found to be a cool ideas but that didn&#8217;t work for me as they were presented (such as the <a href="http://www.commandlinefu.com/commands/view/887/copy-a-mysql-database-to-a-new-server-via-ssh-with-one-command"  target="_blank">command to copy database from a local MySQL server to a remote MySQL server over SSH</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2009/08/04/unix-commands-galore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deleting all network interface aliases</title>
		<link>http://my.galagzee.com/2009/07/22/deleting-all-network-interface-aliases/</link>
		<comments>http://my.galagzee.com/2009/07/22/deleting-all-network-interface-aliases/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 06:13:21 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[deleting IP aliases]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[netstart]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=313</guid>
		<description><![CDATA[I recently needed to move bunch of aliased IPs from one FreeBSD server to another. Adding aliases to /etc/rc.conf and then running ./netstart while in /etc adds new multiplexed IPs to the system all right, but if you need to remove aliased IPs, running /etc/netstart won&#8217;t remove them even if the aliases have been removed]]></description>
			<content:encoded><![CDATA[<p>I recently needed to move bunch of aliased IPs from one FreeBSD server to another. Adding aliases to /etc/rc.conf and then running ./netstart while in /etc <em>adds</em> new multiplexed IPs to the system all right, but if you need to remove aliased IPs, running /etc/netstart won&#8217;t remove them even if the aliases have been removed from /etc/rc.conf. Perhaps there is some easy single command that culls the active alias IPs to those specified in /etc/rc.conf, but I&#8217;m not aware of it.  The following command can be used to quickly delete all aliased IPs for a specific interface (here &#8220;em0&#8243;):</p>
<p><strong>ifconfig | grep &#8220;0xffffffff&#8221; | awk &#8216;{ print $2 }&#8217; | xargs -n 1 ifconfig em0 delete</strong></p>
<p>For this to work, the netmasks of the aliases and the master IP for the inteface must differ. The netmasks of the aliases are usually set to 255.255.255.255 (hence &#8220;0xffffffff&#8221;) while the netmask of the master IP is usually something different, specific to your network, e.g. 255.255.255.128 (&#8220;0xffffff80&#8243;).</p>
<p>Once the above command has been run, /etc/netstart can then be executed to load the remaining or reconfigured aliases (if any) from /etc/rc.conf.</p>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2009/07/22/deleting-all-network-interface-aliases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FreeBSD Full / Incremental Filesystem Dump Shell Script</title>
		<link>http://my.galagzee.com/2009/07/17/freebsd-dump-filesystem-shell-script/</link>
		<comments>http://my.galagzee.com/2009/07/17/freebsd-dump-filesystem-shell-script/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 05:19:25 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[automatic]]></category>
		<category><![CDATA[dump]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[incremental]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=232</guid>
		<description><![CDATA[A FreeBSD shell script to dump filesystems with full, and automatically incremented incremental backups to a given directory location.]]></description>
			<content:encoded><![CDATA[<p>I wanted to automate filesystem dumps on my servers running FreeBSD 7.2.  After some searching I came across Vivek Gite&#8217;s <a href="http://bash.cyberciti.biz/backup/freebsd-dump-filesystem-shell-script/" target="_blank">FreeBSD Full / Incremental <strong>Tape</strong> Backup Shell Script</a> which gave me a lot of ideas.  Since I&#8217;m not using tape as the backup target I wanted to make a script specifically for that purpose while at the same time improve handling of some error conditions (such as, most importantly, checking for a missing level 0 dump before proceeding with an incremental dump) and add some new features such as autoincrement the dump level so that the dump level is not tied to specific day of the week.</p>
<p>Here&#8217;s my version of the script.  While it bears some resemblance to Vivek&#8217;s script, it is largely rewritten.  Read the script header for more information.</p>
<p><strong>NOTE!</strong> In his <a href="http://my.galagzee.com/2009/07/17/freebsd-dump-filesystem-shell-script/#comment-9988">comment</a> <em>James</em> pointed out a possible bug in the script.  The displayed script indeed had a problem: it was missing a backslash in front of the first dollar sign at:</p>
<p>eval &#8220;local fspath=<strong>\</strong>$${fsname}path&#8221;</p>
<p>This was caused by the script display plugin in WordPress that treated the backslash as an escape character (<a href="http://wordpress.org/support/topic/256742?replies=12#post-1168286" target="_blank">this has now been fixed</a>). To be on the safe side, please <strong><a href="http://my.galagzee.com/wp-content/uploads/2009/08/autodump-1.5a.tar">download the script as a tarball</a>.</strong> To further validate the integrity of the tarball, it should produce a md5 hash of 732ac44f11ba4484be4568e84929bb6a. </p>
<p><!--DEVFMTCODE--><pre class="devcodeblock" title=""><div class="devcodeoverflow"><ol><li></li><li>#!/bin/sh</li><li>&nbsp;</li><li># Autodump 1.5a <span class="br0">&#40;</span>released 01 August 2009<span class="br0">&#41;</span></li><li># Copyright <span class="br0">&#40;</span>c<span class="br0">&#41;</span> 2009 Ville Walveranta </li><li>#</li><li># A FreeBSD shell script to dump filesystems with full, and automatically </li><li># incremented incremental backups to a given directory location; this script</li><li># was written with the intent of saving the filesystem dumps not onto a tape</li><li># device but on another hard drive such as a different filesystem on the same </li><li># computer. The resulting dump files can be copied offsite with a separate </li><li># cron job.</li><li>#</li><li># This script creates the necessary directory structure below the defined </li><li># 'BASEDIR' as well as the necessary log file. This script also ensures that</li><li># the level 0 dump exists before creating an incremental dump; if it doesn't</li><li># the script automatically erases the incremental files for the current week </li><li># <span class="br0">&#40;</span>if any exist<span class="br0">&#41;</span> and starts over with a level 0 dump. This way you can start </li><li># using the script on any day of the week and level 0 dump is automatically </li><li># created on the first run.</li><li>#</li><li># When ran daily <span class="br0">&#40;</span>such as from a cron job<span class="br0">&#41;</span>, the script creates level 0 dump</li><li># on every Monday <span class="br0">&#40;</span>beginning the ISO week<span class="br0">&#41;</span>, or Sunday <span class="br0">&#40;</span>beginning of the U.S. </li><li># week<span class="br0">&#41;</span> and an incremental dump on all the other days of each week. The dumps </li><li># are compressed with gzip and saved below the 'BASEDIR' to an automatically </li><li># created directory whose name is derived from the list given in 'FSNAMES'. </li><li># Each week's dumps are organized into subfolders with name YYYY-WW <span class="br0">&#40;</span>'WW' </li><li># being the current week<span class="br0">&#41;</span>. By default three most recent weekly dumps </li><li># <span class="br0">&#40;</span>level 0 + incrementals<span class="br0">&#41;</span> are retained.</li><li>#</li><li># The script maintains each weekly folder's date at the _beginning_ date</li><li># of the dump <span class="br0">&#40;</span>i.e. Monday or Sunday of the current week<span class="br0">&#41;</span> at 00:00, not </li><li># at the most recent incremental's date/time.</li><li>#</li><li># By default the root <span class="br0">&#40;</span>/<span class="br0">&#41;</span> and usr <span class="br0">&#40;</span>/usr<span class="br0">&#41;</span> filesystems are dumped. To add more&nbsp;&nbsp;</li><li># add a &quot;friendly name&quot; to the 'FSNAMES' list <span class="br0">&#40;</span>it is used for the weekly folder</li><li># names, for dump filenames, and to reference the corresponding mount point</li><li># variable<span class="br0">&#41;</span>; then add the corresponding mount point variable <span class="br0">&#40;</span>i.e. if you </li><li># add &quot;var&quot; to 'FSNAMES', then add a variable varpath=/var<span class="br0">&#41;</span>. The &quot;path&quot; </li><li># ending of the mount point variable name is required. </li><li>#</li><li># Since the number of incremental dumps is limited to nine <span class="br0">&#40;</span>level 0 +</li><li># incremental levels 1-9<span class="br0">&#41;</span>, the script will allow maximum of one dump </li><li># to be created per day. However, since the level incrementing is dynamic</li><li># you can start the script on any day of the week, and run it on any</li><li># number of days during the rest of the week and you'll always get</li><li># level 0 plus the incremental dumps in sequential order. However, The </li><li># new weekly folder is always created on Monday or Sunday <span class="br0">&#40;</span>as chosen by</li><li># you<span class="br0">&#41;</span>. Note that the script determines whether &quot;today's&quot; dump exists </li><li># based on the modification date stamp of the most recent dump. Hence </li><li># it is a good idea to run this script in the early hours of each day </li><li># rather than in the very end of each day. Running the script, for </li><li># example, at 23:50 has the potential to push longer dump processes </li><li># over the midnight and so potentially cause the next day's dump to </li><li># be skipped.</li><li>#</li><li># Written for FreeBSD 7.2 but should work on most BSD and *NIX systems with</li><li># minor modifications.</li><li># -------------------------------------------------------------------------</li><li># Copyright <span class="br0">&#40;</span>c<span class="br0">&#41;</span> 2009 Ville Walveranta </li><li># &lt;http://my.galagzee.com/2009/07/17/freebsd-dump-filesystem-shell-script&gt;</li><li># This script is licensed under GNU GPL version 2.0 or above, and is provided</li><li># 'as-is' with no warranty which is to say that I'm not liable if it wipes out</li><li># your hard drive clean or doesn't back up your precious data. However, to the </li><li># best or my knowledge it is working as expected -- I'm using it myself. :-<span class="br0">&#41;</span></li><li># -------------------------------------------------------------------------</li><li># This script was inspired by </li><li># FreeBSD Full / Incremental Tape Backup Shell Script</li><li># by nixCraft project / Vivek Gite</li><li># at &lt;http://bash.cyberciti.biz/backup/freebsd-dump-filesystem-shell-script/&gt;</li><li># -------------------------------------------------------------------------</li><li>&nbsp;</li><li>&nbsp;</li><li>#### GLOBAL VARIABLES ###############################################</li><li>&nbsp;</li><li>WEEKSTARTS=Mon&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Accepted values are &quot;Mon&quot; <span class="br0">&#40;</span>ISO standard<span class="br0">&#41;</span> or &quot;Sun&quot; <span class="br0">&#40;</span>U.S.<span class="br0">&#41;</span></li><li>KEEPDUMPS=30&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# in days; this is evaluated on the weekly level per start</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# of the week, so '30' keeps 3-4 weekly dumps</li><li>BASEDIR=/bak/dumps</li><li>GLOBALDUMPOPTS=Lua&nbsp;&nbsp;# add 'n' for wall notifications</li><li>LOGFILE=/var/log/dump.log</li><li>&nbsp;</li><li># to add more filesystems to be dumped add the dump name in 'FSNAMES'</li><li># and add the corresponding mount point variable <span class="br0">&#40;</span>dumpname+path=mountpoint<span class="br0">&#41;</span></li><li>FSNAMES=&quot;root usr&quot;&nbsp;&nbsp;# this is used for dump directory name </li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# and to ID the path from a variable below</li><li>rootpath=/</li><li>usrpath=/usr</li><li>&nbsp;</li><li>#####################################################################</li><li>&nbsp;</li><li>DUMP=/sbin/dump</li><li>GZIP=/usr/bin/gzip</li><li>LOGGER=/usr/bin/logger</li><li>&nbsp;</li><li>WEEKDAY=$<span class="br0">&#40;</span>date +&quot;%a&quot;<span class="br0">&#41;</span></li><li>DATE=$<span class="br0">&#40;</span>date +&quot;%Y%m%d&quot;<span class="br0">&#41;</span></li><li>HUMANDATE=$<span class="br0">&#40;</span>date +&quot;%d-%b-%Y&quot;<span class="br0">&#41;</span></li><li>HUMANDATE=`echo $HUMANDATE | tr '<span class="br0">&#91;</span>:lower:<span class="br0">&#93;</span>' '<span class="br0">&#91;</span>:upper:<span class="br0">&#93;</span>'`</li><li>HUMANTIME=$<span class="br0">&#40;</span>date +&quot;%H:%M <span class="br0">&#40;</span>%Z<span class="br0">&#41;</span>&quot;<span class="br0">&#41;</span></li><li>TODAYYR=$<span class="br0">&#40;</span>date +&quot;%Y&quot;<span class="br0">&#41;</span></li><li>TODAYMO=$<span class="br0">&#40;</span>date +&quot;%m&quot;<span class="br0">&#41;</span></li><li>TODAYDT=$<span class="br0">&#40;</span>date +&quot;%d&quot;<span class="br0">&#41;</span></li><li>&nbsp;</li><li># datestamp at midnight today</li><li>TODAYSTARTSTAMP=$<span class="br0">&#40;</span>date -j +%s &quot;$<span class="br0">&#123;</span>TODAYYR<span class="br0">&#125;</span>$<span class="br0">&#123;</span>TODAYMO<span class="br0">&#125;</span>$<span class="br0">&#123;</span>TODAYDT<span class="br0">&#125;</span>0000&quot;<span class="br0">&#41;</span></li><li>&nbsp;</li><li># default lastdump to midnight today; it will be checked</li><li># and and adjusted later</li><li>LASTDUMP=$TODAYSTARTSTAMP</li><li>&nbsp;</li><li># do not crete world-readable dumps!</li><li>umask 117</li><li>&nbsp;</li><li># make sure the logfile exists</li><li>if <span class="br0">&#91;</span> ! -e $LOGFILE <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp; touch $LOGFILE</li><li>&nbsp;&nbsp; chmod 660 $LOGFILE</li><li>fi</li><li>&nbsp;</li><li># make sure that entire week's incremental dumps are deposted</li><li># in the same directory, even when a week spans new year</li><li># NOTE: When the ending year has a partial 53rd week, there</li><li># won't be a dump folder for the first week of the new year.</li><li># The incremental dumps instead complete the 53rd week folder,</li><li># even when the 1st week of the new year begins mid-week. </li><li># However, the dates of the incremental dump files in the </li><li># 53rd week folder correctly reflect the dates of the </li><li># beginning year.</li><li>adjust_date<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></li><li>&nbsp;&nbsp; local dateoffset=$1</li><li>&nbsp;&nbsp; local epochnow=$<span class="br0">&#40;</span>date +%s<span class="br0">&#41;</span></li><li>&nbsp;&nbsp; local offsetsecs=`expr $dateoffset &quot;*&quot; 86400`</li><li>&nbsp;&nbsp; local newepoch=`expr $epochnow &quot;-&quot; $offsetsecs`</li><li>&nbsp;&nbsp; local year=`date -r $newepoch +&quot;%Y&quot;`</li><li>&nbsp;</li><li>&nbsp;&nbsp; if <span class="br0">&#91;</span> &quot;$WEEKSTARTS&quot; = &quot;Mon&quot; <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local week=`date -r $newepoch +&quot;%W&quot;`</li><li>&nbsp;&nbsp; else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local week=`date -r $newepoch +&quot;%U&quot;`</li><li>&nbsp;&nbsp; fi</li><li>&nbsp;&nbsp; NEWEPOCHISO=`date -r $newepoch +&quot;%Y%m%d0000&quot;`</li><li>&nbsp;</li><li>&nbsp;&nbsp; #system week starts from `0', there is no calendar week `0'</li><li>&nbsp;&nbsp; week=`expr $week &quot;+&quot; 1`</li><li>&nbsp;&nbsp; YWEEK=$<span class="br0">&#123;</span>year<span class="br0">&#125;</span>-$<span class="br0">&#123;</span>week<span class="br0">&#125;</span></li><li><span class="br0">&#125;</span></li><li>&nbsp;</li><li># determines the 'distance' from the level 0 dump in days</li><li>if <span class="br0">&#91;</span> &quot;$WEEKSTARTS&quot; = &quot;Mon&quot; <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp; case $WEEKDAY in</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mon<span class="br0">&#41;</span> adjust_date <span style="">0</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tue<span class="br0">&#41;</span> adjust_date <span style="">1</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wed<span class="br0">&#41;</span> adjust_date <span style="">2</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thu<span class="br0">&#41;</span> adjust_date <span style="">3</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fri<span class="br0">&#41;</span> adjust_date <span style="">4</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sat<span class="br0">&#41;</span> adjust_date <span style="">5</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sun<span class="br0">&#41;</span> adjust_date <span style="">6</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<span class="br0">&#41;</span> ;;</li><li>&nbsp;&nbsp; esac</li><li>else </li><li>&nbsp;&nbsp; case $WEEKDAY in</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sun<span class="br0">&#41;</span> adjust_date <span style="">0</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Mon<span class="br0">&#41;</span> adjust_date <span style="">1</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Tue<span class="br0">&#41;</span> adjust_date <span style="">2</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Wed<span class="br0">&#41;</span> adjust_date <span style="">3</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Thu<span class="br0">&#41;</span> adjust_date <span style="">4</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fri<span class="br0">&#41;</span> adjust_date <span style="">5</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Sat<span class="br0">&#41;</span> adjust_date <span style="">6</span>;;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*<span class="br0">&#41;</span> ;;</li><li>&nbsp;&nbsp; esac</li><li>fi</li><li>&nbsp;</li><li>mk_auto_dump<span class="br0">&#40;</span><span class="br0">&#41;</span><span class="br0">&#123;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp; local fsname=$1</li><li>&nbsp;</li><li>&nbsp;&nbsp; # get the current filesystem's path</li><li>&nbsp;&nbsp; # as defined in the corresponding variable</li><li>&nbsp;&nbsp; eval &quot;local fspath=\$$<span class="br0">&#123;</span>fsname<span class="br0">&#125;</span>path&quot;</li><li>&nbsp;</li><li>&nbsp;&nbsp; # composite the dump path</li><li>&nbsp;&nbsp; local dumppath=$<span class="br0">&#123;</span>BASEDIR<span class="br0">&#125;</span>/$<span class="br0">&#123;</span>fsname<span class="br0">&#125;</span>/$<span class="br0">&#123;</span>YWEEK<span class="br0">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp; # make sure the dump directory for this week exists;</li><li>&nbsp;&nbsp; # this automatically creates a new dump directory on </li><li>&nbsp;&nbsp; # every Monday or Sunday <span class="br0">&#40;</span>as selected by 'WEEKSTARTS'<span class="br0">&#41;</span></li><li>&nbsp;&nbsp; <span class="br0">&#91;</span> ! -d $dumppath <span class="br0">&#93;</span> &amp;&amp; mkdir -p $dumppath</li><li>&nbsp;</li><li>&nbsp;&nbsp; # get name of the last file in the current dump directory</li><li>&nbsp;&nbsp; local lastfile=`ls -ltr $dumppath | grep -v &quot;^d&quot; | tail -n 1 | awk '<span class="br0">&#123;</span> print $9 <span class="br0">&#125;</span>'`</li><li>&nbsp;</li><li>&nbsp;&nbsp; # assume that the 'lastfile', if it exists, was not created today</li><li>&nbsp;&nbsp; local dumped_today=false</li><li>&nbsp;</li><li>&nbsp;&nbsp; # if a file exists, check its modification date; </li><li>&nbsp;&nbsp; # if it is at or after 00:00 today, set a flag to skip the dump</li><li>&nbsp;&nbsp; if <span class="br0">&#91;</span> &quot;$lastfile&quot; != &quot;&quot; <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local fq_lastfile=$<span class="br0">&#123;</span>dumppath<span class="br0">&#125;</span>/$lastfile</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span class="br0">&#91;</span> -e $fq_lastfile <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # get the last modification time for the most recently created dumpfile</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; LASTDUMP=`stat -f %m $fq_lastfile`</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if <span class="br0">&#91;</span> $LASTDUMP -ge $TODAYSTARTSTAMP <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local dumped_today=true</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fi</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# get the first and the last dump level for this directory</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local levelcommand=&quot;ls $dumppath | sed -e 's/^<span class="br0">&#91;</span><span class="br0">&#91;</span>:digit:<span class="br0">&#93;</span><span class="br0">&#93;</span>*\_//' | sed -e 's/\..*$//'&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local firstlevel=`eval $levelcommand | head -n 1`</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local lastlevel=`eval $levelcommand | tail -n 1`</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# make sure level zero dump exists;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if it doesn't, start over</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span class="br0">&#91;</span> &quot;$firstlevel&quot; != &quot;0&quot; <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # it doesn't matter if a previous dump exists from today</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # since we're starting over as level 0 dump is missing</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local dumped_today=false</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local dumplevel=0</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rm -f $dumppath/*.gz</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # otherwise just increment the dump level</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # for levels 1-6, i.e. normally Tuesday thru Sunday</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; local dumplevel=`expr $lastlevel &quot;+&quot; 1`</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi</li><li>&nbsp;&nbsp; else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# no dump exists in this week's folder; reset level to '0'</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local dumplevel=0</li><li>&nbsp;&nbsp; fi</li><li>&nbsp;</li><li>&nbsp;&nbsp; # skip the entire dump process if a dumpfile has</li><li>&nbsp;&nbsp; # already been created for this filesystem today</li><li>&nbsp;&nbsp; if <span class="br0">&#91;</span> &quot;$dumped_today&quot; = &quot;false&quot; <span class="br0">&#93;</span> ; then&nbsp;&nbsp;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# define the dump filename</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local dumpfn=$<span class="br0">&#123;</span>DATE<span class="br0">&#125;</span>_$<span class="br0">&#123;</span>dumplevel<span class="br0">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo ---------------- &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo BEGINNING LEVEL $dumplevel DUMP OF \'$fsname\' \<span class="br0">&#40;</span>$<span class="br0">&#123;</span>fspath<span class="br0">&#125;</span>\<span class="br0">&#41;</span> FILESYSTEM ON $HUMANDATE AT $HUMANTIME &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo Creating a snapshot of \'$fspath\'.. &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# execute the dump</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$DUMP -$dumplevel -$GLOBALDUMPOPTS -f $<span class="br0">&#123;</span>dumppath<span class="br0">&#125;</span>/$<span class="br0">&#123;</span>dumpfn<span class="br0">&#125;</span> $fspath &gt;&gt; $LOGFILE 2&gt;&amp;1</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local dumpresult=$?</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if <span class="br0">&#91;</span> &quot;$dumpresult&quot; != &quot;0&quot; <span class="br0">&#93;</span> ; then</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # log the dump result to syslog</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $LOGGER &quot;$DUMP LEVEL $dumplevel DUMP OF $fsname <span class="br0">&#40;</span>$<span class="br0">&#123;</span>fspath<span class="br0">&#125;</span><span class="br0">&#41;</span> FAILED!&quot;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &quot;*** DUMP FAILED - LEVEL $dumplevel DUMP of $fsname <span class="br0">&#40;</span>$<span class="br0">&#123;</span>fspath<span class="br0">&#125;</span><span class="br0">&#41;</span> ***&quot; &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # log the dump result to syslog</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $LOGGER &quot;LEVEL $dumplevel DUMP of $fsname <span class="br0">&#40;</span>$<span class="br0">&#123;</span>fspath<span class="br0">&#125;</span><span class="br0">&#41;</span> COMPLETED SUCCESSFULLY!&quot;</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # compress the dump</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo Compressing the dumpfile \'$<span class="br0">&#123;</span>dumpfn<span class="br0">&#125;</span>\'.. &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $GZIP -v $<span class="br0">&#123;</span>dumppath<span class="br0">&#125;</span>/$<span class="br0">&#123;</span>dumpfn<span class="br0">&#125;</span> &gt;&gt; $LOGFILE 2&gt;&amp;1</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo DONE &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &gt;&gt; $LOGFILE</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # make sure dumps are not world readable <span class="br0">&#40;</span>security risk!<span class="br0">&#41;</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo Updating dumpfile \'$<span class="br0">&#123;</span>dumpfn<span class="br0">&#125;</span>.gz\' permissions.. &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; chmod -v -v 440 $<span class="br0">&#123;</span>dumppath<span class="br0">&#125;</span>/$<span class="br0">&#123;</span>dumpfn<span class="br0">&#125;</span>.gz &gt;&gt; $LOGFILE 2&gt;&amp;1</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo DONE &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &gt;&gt; $LOGFILE</li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # reset current dump dir's timestamp to that of the level 0 dump</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; touch -t $<span class="br0">&#123;</span>NEWEPOCHISO<span class="br0">&#125;</span> $<span class="br0">&#123;</span>dumppath<span class="br0">&#125;</span></li><li>&nbsp;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # delete old dumps</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo Deleting old \'$fsname\' dumpfiles.. &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; find $BASEDIR/$fsname -mtime +$KEEPDUMPS -maxdepth 1 -print -exec rm -rf <span class="br0">&#123;</span><span class="br0">&#125;</span> \; &gt;&gt; $LOGFILE <span style="">2</span>&gt;&amp;<span style="">1</span></li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo DONE &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; echo &gt;&gt; $LOGFILE</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;fi</li><li>&nbsp;&nbsp; else</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local lastdump_readable=`date -j -r $LASTDUMP +&quot;%H:%M&quot;`</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local lastdump_readableZ=`date -j -r $LASTDUMP +&quot;%Z&quot;`</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;local lastdumpmsg=&quot;Autodump for filesystem '$fsname' <span class="br0">&#40;</span>$fspath<span class="br0">&#41;</span> has already been executed today at $lastdump_readable <span class="br0">&#40;</span>$lastdump_readableZ<span class="br0">&#41;</span>.&quot;</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo $lastdumpmsg</li><li>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$LOGGER $lastdumpmsg</li><li>&nbsp;&nbsp; fi</li><li><span class="br0">&#125;</span></li><li>&nbsp;</li><li>&nbsp;</li><li># Dump filesystems defined in 'FSNAMES'</li><li>#</li><li># Monday or Sunday <span class="br0">&#40;</span>as selected by 'WEEKSTARTS'<span class="br0">&#41;</span> starts with </li><li># the level <span style="">0</span> dump, with incrementals created through the rest of </li><li># the week <span class="br0">&#40;</span>autoincremented<span class="br0">&#41;</span>. If the level <span style="">0</span> dump is missing in </li><li># the current week's folder for filesystem currently being backed </li><li># up, it is created automatically instead of an incremental dump, </li><li># no matter what day of the week it is.</li><li>for f in $FSNAMES</li><li>do</li><li>&nbsp;&nbsp; mk_auto_dump $f</li><li>done</li><li></li></ol></div></pre><!--END_DEVFMTCODE--></p>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2009/07/17/freebsd-dump-filesystem-shell-script/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>FreeBSD vs the world</title>
		<link>http://my.galagzee.com/2009/06/22/freebsd-vs-the-world/</link>
		<comments>http://my.galagzee.com/2009/06/22/freebsd-vs-the-world/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 00:59:58 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[comparison]]></category>
		<category><![CDATA[freebsd]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=225</guid>
		<description><![CDATA[As I upgraded few FreeBSD installations to FreeBSD 7.2 over the last couple of days, I took the customary stroll to see how FreeBSD continues to stack up against the Linux distributions.  And once again I determined it does so very well.  I&#8217;ve been a devout FreeBSD user for almost a decade, and every time]]></description>
			<content:encoded><![CDATA[<p>As I upgraded few FreeBSD installations to FreeBSD 7.2 over the last couple of days, I took the customary stroll to see how FreeBSD continues to stack up against the Linux distributions.  And once again I determined it does so very well.  I&#8217;ve been a devout FreeBSD user for almost a decade, and every time I take a look at the Linux world I come back to the same conclusion: I like the fact that there is just one FreeBSD. It&#8217;s very well managed and its QA is excellent (not to mention its TCP stack is famed for being the most stable, and its ports collection rivals anything offered by Linux).</p>
<p>Here&#8217;re couple of useful sites for those wondering which OS to choose:</p>
<p><a href="http://polishlinux.org/choose/comparison/?distro1=FreeBSD&amp;distro2=Debian" target="_blank">Polishlinux.org &#8211; Compare distros: FreeBSD vs. Debian</a> &#8211; Comparison data is up to date and there are a lot of good user comments to sift through. You can also choose other distros to compare to.</p>
<p><a href="http://en.wikipedia.org/wiki/Comparison_of_BSD_operating_systems" target="_blank">Wikipedia &#8211; Comparison of BSD operating systems</a></p>
<p>And lastly, a good example of why the sheer number of Linux distros is disorienting: <a href="http://distrowatch.com/" target="_blank">DistroWatch</a> lists at least a few hundred Linux distros (plus couple of BSD derivatives).</p>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2009/06/22/freebsd-vs-the-world/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fusemail, strike one</title>
		<link>http://my.galagzee.com/2009/05/03/fusemail-strike-one/</link>
		<comments>http://my.galagzee.com/2009/05/03/fusemail-strike-one/#comments</comments>
		<pubDate>Sun, 03 May 2009 06:14:56 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Rants]]></category>
		<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[fusemail]]></category>
		<category><![CDATA[mailtrust]]></category>
		<category><![CDATA[outsourcing]]></category>
		<category><![CDATA[webmail]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=204</guid>
		<description><![CDATA[Over last several weeks I&#8217;ve gradually externalized both my own and my employer&#8217;s mail systems from internal servers to an outsourced service.  My own mail has been running for years on qmail on FreeBSD.  It&#8217;s worked well, but the age of my own server has become a growing concern, and in general in event of]]></description>
			<content:encoded><![CDATA[<p>Over last several weeks I&#8217;ve gradually externalized both my own and my employer&#8217;s mail systems from internal servers to an outsourced service.  My own mail has been running for years on qmail on FreeBSD.  It&#8217;s worked well, but the age of my own server has become a growing concern, and in general in event of a system failure mail would not flow &#8211; that&#8217;s not good, and nobody&#8217;s going to fix it if I&#8217;m out of town.  So paying couple of bucks per month per mailbox is—at least in theory—worth it to not have to stress over mail system (even though I&#8217;ve found Postfix/Dovecot really interesting and actually quite pleasant to configure.. I was going to move the qmail system to Postfix before I started thinking about outsourcing the whole thing to save time).</p>
<p>Meanwhile, my employer&#8217;s email has been running on Exchange for several years, starting preceding my time with the company.  It has been a grief, though I&#8217;m sure it&#8217;s partially due to the fact that the the mail server is also the domain controller of a small office LAN. But why should it be? Qmail or Postfix run quite well on a Linux/*BSD server with Apache, MySQL, BIND. So I&#8217;ve been looking forward getting rid of Exchange, and migrating to Postfix/Dovecot system until, again, I started thinking that perhaps it&#8217;s not worth the stress to run an internal mail server. I&#8217;m the only person tending to it and, say, if I&#8217;m on a vacation and the mail goes down, it would not be good.</p>
<p>Once I started considering outsourcing email an option, I started evaluating various services. Fusemail and Mailtrust quickly bubbled to the top. Fusemail has more features, and the deciding factors (in Fusemail&#8217;s favor) were the ability to adjust the spam filtering (Mailtrust only has &#8220;on&#8221; or &#8220;off&#8221; options which is a bit scary — if the filtering is too stringent or too lenient, there&#8217;d be nothing that could be done about it.. Mailtrust&#8217;s rep suggested that I might want to look into an external spam filtering solution if I wanted more control.. but no thanks; I had been running Katharion for mail filtering for several months which worked ok, but if I was going to outsource the mail, I wanted an integrated solution), and the ability to increase a mailbox allocation for an individual user by purchasing more user accounts and allocating their mailbox allowance to the existing users. Mailtrust is fixed to 10Gb.</p>
<p>On the web there is about 50/50 comments for and against the quality of support for both Fusemail and Mailtrust, so from the comments alone it was impossible to deduce which service would have better support. Pre-sales support was slightly better on Fusemail side, and the few quirks ran across during setup have been addressed satisfactorily.</p>
<p><strong>Strike One</strong></p>
<p>Tonight (Saturday evening) around 18:00 my user account under my employer&#8217;s master account suddenly disappeared.  I access mail from Outlook via IMAP, and suddenly Outlook prompted for the account password. So I logged in to Fusemail admin account and clicked on my user name. [Paraphrasing] &#8220;Cannot edit terminated user account&#8221;.  What?! To terminate a user account in Fusemail you have to check the checkbox next to the user name, click &#8220;Terminate&#8221;, check another checkbox (&#8220;yes, I&#8217;m sure I want to do that&#8221;), and then click on &#8220;Yes&#8221;. Only then does a user account get removed, or scheduled for deletion as it takes many, many hours for the username actually be purged from the system so that it can be taken into use again. I most certainly did not execute those steps.  I&#8217;m the only one with access to that admin account, and the password is sufficiently complex so that it&#8217;s very unlikely the account would&#8217;ve been compromised. This leaves system error as the most likely cause.  I called the emergency support around 18:30 and left a message (they claim to have someone on call), then again again around 20:00, and also opened an &#8220;Urgent&#8221; support ticket through their support system at 22:40.  It&#8217;s now over six hours since my first &#8220;emergency&#8221; support request, so I can only assume the on-call person has gone to party (or that they don&#8217;t have an on-call tech in the first place). The emergency support number instructs the caller that &#8220;while the support technician is not immediately available, it does not mean that support would not be available immediately&#8221;. It&#8217;s looking like they were wrong.</p>
<p>I didn&#8217;t lose a tremendous amount of email (and perhaps Fusemail can restore it), but during this downtime emails to my account which has multiple &#8220;admin&#8221; aliases are being rejected.  If I was running my own mail server I could obviously have fixed a problem already, but an outsourced solution is supposed to *reduce* system management stress.</p>
<p>Longevity of this outsourcing attempt depends largely on how Fusemail will deal with this situation. Having to reconfigure my user account and its associated aliases would be annoying, but more than restore I want to know what caused the problem, can they be sure to prevent it from recurring, and what&#8217;s the deal with the non-existent emergency support.</p>
<p>If the deleted account would&#8217;ve been that of the CEO of my employer, or my personal primary account (which I have also outsourced to Fusemail in a separate account), this first strike would&#8217;ve likely been also the last for Fusemail.</p>
<p>&#8211;</p>
<p>Couple of considerations for those who&#8217;re comparing, say, Fusemail and Mailtrust, or considering mail outsourcing in the first place:</p>
<ul>
<li>Forward/distribution management is currently better implemented in Mailtrust.  It&#8217;s workable in Fusemail, but it&#8217;s more straightforward in Mailtrust. If this is an important feature to you, pay attention when you&#8217;re comparing the services.</li>
<li>Secure connections (SMTP, IMAP, POP) work better with Mailtrust than with Fusemail. Fusemail is supposedly looking into this. Not a huge issue for me since the SMTP traffic is generally not encrypted anyway, so encrypting the last leg (from the service to the client) isn&#8217;t very significant.</li>
<li>Fusemail&#8217;s IMAP is not blazingly fast even when accessed from a fast net connection. Same goes occasionally for their web client. They are, however, generally within acceptable limits.</li>
<li>A general comment if you&#8217;re using SPF: when you use a service provider&#8217;s SMTP servers you can&#8217;t positively lock down who&#8217;s authorized to send mail for your domain. If someone who&#8217;s hosting their mail at Fusemail decides to send spam spoofing one of my domains, they&#8217;ll appear as authorized for the recipient&#8217;s spam filter since I&#8217;ve authorized Fusemail&#8217;s SMTP servers in my domains&#8217; SPF records.</li>
<li>Test (!) the support of different providers by sending them a support request on Saturday evening. See when you get a response. Fusemail claims on their website: &#8220;24x7x365 Support&#8221;, but I&#8217;m now finding that it is not completely solid; it should instead read: &#8220;You can <em>leave us a message</em> 24x7x365&#8243;.</li>
<li>If you don&#8217;t have large number of users to support and they use IMAP to access the remote email, consider setting up backup mailboxes at gmail (free!), and creating a mail rule (available at least in Fusemail) which automatically copies those backup mailboxes for all inbound email.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2009/05/03/fusemail-strike-one/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
		<item>
		<title>Unix Shell: find files by a date range</title>
		<link>http://my.galagzee.com/2009/02/23/unix-shell-find-files-by-a-date-range/</link>
		<comments>http://my.galagzee.com/2009/02/23/unix-shell-find-files-by-a-date-range/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 22:13:50 +0000</pubDate>
		<dc:creator>Ville Walveranta</dc:creator>
				<category><![CDATA[Technical]]></category>
		<category><![CDATA[UNIX]]></category>
		<category><![CDATA[files]]></category>
		<category><![CDATA[shell]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://my.galagzee.com/?p=181</guid>
		<description><![CDATA[I needed to restore some files from an archive on UNIX, but only the files of a particular date-range were needed.  It took a few moments to find and figure out how I could easily extract files older than a particular date, or files from a particular date-range. This is how: Create a perimeter file,]]></description>
			<content:encoded><![CDATA[<p>I needed to restore some files from an archive on UNIX, but only the files of a particular date-range were needed.  It took a few moments to find and figure out how I could easily extract files older than a particular date, or files from a particular date-range. This is how:</p>
<ol>
<li>Create a perimeter file, like so:<br />
<strong>touch -t yyyymmddHHMM marker_date</strong></p>
<p><strong></strong></li>
<li>List files <em>older </em>than the marker_date:<br />
<strong>find . -type f ! -newer marker_date -ls</strong><br />
Of course, instead of `-ls&#8217; parameter (to list), you can use `-print&#8217; and a pipe to xargs to, for example, delete the selected files, etc.</li>
</ol>
<p>Likewise, for a range of dates:</p>
<ol>
<li>Create the perimeter files:<br />
<strong>touch -t yyyymmddHHMM range_start<br />
touch -t yyyymmddHHMM range_end</strong></p>
<p><strong></strong></li>
<li>List the files <em>between</em> the range dates:<br />
<strong>find . -type f -newer range_start <span style="color: red;">!</span> -newer range_end -ls</strong></li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://my.galagzee.com/2009/02/23/unix-shell-find-files-by-a-date-range/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
