<?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>blog.lundscape.com &#187; Cron</title>
	<atom:link href="http://blog.lundscape.com/tag/cron/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.lundscape.com</link>
	<description>The Linux Journey</description>
	<lastBuildDate>Thu, 15 Apr 2010 20:06:18 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Delaying Email Delivery Using Procmail and Cron</title>
		<link>http://blog.lundscape.com/2009/11/delaying-email-delivery-using-procmail-and-cron/</link>
		<comments>http://blog.lundscape.com/2009/11/delaying-email-delivery-using-procmail-and-cron/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 20:17:28 +0000</pubDate>
		<dc:creator>Zachary Lund</dc:creator>
				<category><![CDATA[Procmail]]></category>
		<category><![CDATA[Cron]]></category>
		<category><![CDATA[Formail]]></category>
		<category><![CDATA[Mutt]]></category>
		<category><![CDATA[Spam]]></category>

		<guid isPermaLink="false">http://blog.lundscape.com/?p=279</guid>
		<description><![CDATA[Because I use Mutt, any mailbox that has new mail tends to get my attention when I check my email. This became particularly annoying because I kept opening my spam mailbox to check a single spam message. Therefore, I decided to come up with a way to delay the delivery of my spam to once [...]]]></description>
			<content:encoded><![CDATA[<p>Because I use Mutt, any mailbox that has new mail tends to get my attention when I check my email. This became particularly annoying because I kept opening my spam mailbox to check a single spam message. Therefore, I decided to come up with a way to delay the delivery of my spam to once per day.</p>
<p>I started by changing my &#8220;.procmailrc&#8221; to deliver spam messages to a different mailbox that Mutt does not check.</p>
<pre>MAIL=`echo $HOME/Mail`
[...]
:H
* ^X-Spam-Status: Yes
$MAIL/delay_spam
[...]</pre>
<p>Then I created a new procmailrc file called &#8220;spam.procmailrc&#8221; that would deliver mail to my checked spam mailbox.</p>
<pre>MAIL=`echo $HOME/Mail`

:0
$MAIL/spam</pre>
<p>Next, I wrote a short Bash script to use Formail and Procmail to deliver all of the messages in the delayed delivery spam mailbox to the normal spam mailbox.</p>
<pre>#! /bin/bash

FORMAIL=/usr/bin/formail
PROCMAIL=/usr/bin/procmail
PROCMAILRC=$HOME/.procmail/spam.procmailrc

MAIL=$HOME/Mail
DELAY=$MAIL/delay_spam
TEMP=$MAIL/.spam
LOCK=$TEMP.lock

# Make sure there is delayed mail and we can get the lock (retry once)
if ( test -s $DELAY &#038;&#038; lockfile -r 1 $LOCK 2>/dev/null ); then

    # Add the delayed mail to the temp mailbox and empty the delayed mailbox
    cat $DELAY >> $TEMP &#038;&#038; cat /dev/null > $DELAY
    # Process each delayed message
    $FORMAIL -s $PROCMAIL $PROCMAILRC < $TEMP &#038;&#038; rm -f $TEMP

    # Delete the lock now that we are done
    rm -f $LOCK
fi</pre>
<p>Finally, I set the script to run daily using Cron. Now I am only interrupted by spam when I choose to be instead of every time a new message arrives. I have used the same technique to delay the delivery of emails to unimportant mailing lists so I only read them hourly instead of every time a message arrives.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lundscape.com/2009/11/delaying-email-delivery-using-procmail-and-cron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>OWA Sync on Ubuntu</title>
		<link>http://blog.lundscape.com/2009/04/owa-sync-on-ubuntu/</link>
		<comments>http://blog.lundscape.com/2009/04/owa-sync-on-ubuntu/#comments</comments>
		<pubDate>Mon, 06 Apr 2009 22:56:38 +0000</pubDate>
		<dc:creator>Zachary Lund</dc:creator>
				<category><![CDATA[Mutt]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Cron]]></category>
		<category><![CDATA[lbdb]]></category>
		<category><![CDATA[OWA Sync]]></category>
		<category><![CDATA[PHP iCalendar]]></category>
		<category><![CDATA[Ubuntu]]></category>

		<guid isPermaLink="false">http://blog.lundscape.com/?p=98</guid>
		<description><![CDATA[Update: OWA Sync V0.6 (the current version) is not compatible with Exchange 2007. When I set this up, I was connecting to Exchange 2003.
I use OWA Sync to get all of my calendar information onto my Ubuntu desktop. I recently rediscovered the Little Brother&#8217;s Database and decided to make my OWA contacts available in Mutt [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update: OWA Sync V0.6 (the current version) is not compatible with Exchange 2007. When I set this up, I was connecting to Exchange 2003.</strong></p>
<p>I use <a href="http://www.cobb.uk.net/OWA/owasync.html">OWA Sync</a> to get all of my calendar information onto my Ubuntu desktop. I recently rediscovered the <a href="http://www.spinnaker.de/lbdb/">Little Brother&#8217;s Database</a> and decided to make my OWA contacts available in <a href="http://www.mutt.org/">Mutt</a> on my Ubuntu desktop, too. (I used lbdb to make my contacts in Apple Address Book available to Mutt when I was still using Mac OS X as my primary operating system.)</p>
<p>The OWA Sync website has a decent explanation of creating a owaSyncrc file. After I created that, I wrote a script that runs as a cron job.</p>
<pre>#! /bin/bash

export PATH=$PATH:/usr/local/bin/

/usr/local/bin/owaSync.kit -update

cat $HOME/.owa/Calendar/*.ics > $HOME/.calendar.ics
cat $HOME/.owa/Contacts/*.vcf > $HOME/.contacts.vcf</pre>
<p>After a bit of trial and error, I figured out that &#8220;/usr/local/bin/&#8221; needed to be in the path for the owaSync.kit script to run. After the synchronization is complete, I then concatenate all of the calendar events into a single file and all of the contact cards into a single file. I now have a single calendar file that I can use with <a href="http://phpicalendar.net/">PHP iCalendar</a> and a single contacts file that I can use with lbdb. It requires a fairly simple rc file that looks something like this:</p>
<pre>METHODS="$METHODS m_vcf m_muttalias"

VCF_FILES="$HOME/.contacts.vcf"
MUTTALIAS_FILES="$HOME/.mutt/aliases"</pre>
<p>I add &#8220;m_vcf&#8221; and &#8220;m_muttaliases&#8221; to the &#8220;METHODS&#8221; and then I specify the locations of my OWA contacts and my Mutt aliases. Now when I launch Mutt, I can query for addresses that I downloaded from OWA.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lundscape.com/2009/04/owa-sync-on-ubuntu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>AWStats on Ubuntu Server</title>
		<link>http://blog.lundscape.com/2009/02/awstats-on-ubuntu-server/</link>
		<comments>http://blog.lundscape.com/2009/02/awstats-on-ubuntu-server/#comments</comments>
		<pubDate>Mon, 16 Feb 2009 23:46:23 +0000</pubDate>
		<dc:creator>Zachary Lund</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[AWStats]]></category>
		<category><![CDATA[Cron]]></category>

		<guid isPermaLink="false">http://blog.lundscape.com/?p=30</guid>
		<description><![CDATA[Since I am running this blog on my own server, I decided I should probably set up some log parsing. My <a href="http://www.zacintosh.com/">personal website</a> is hosted by <a href="http://www.nearlyfreespeech.net/">Nearly Free Speech</a>, and they provide <a href="http://awstats.sourceforge.net/">AWStats</a> for statistics. Another <a href="http://www.twincitiestec.org/">site</a> I administer is hosted by <a href="http://www.dreamhost.com/">DreamHost</a>. DreamHost provides <a href="http://www.analog.cx/">Analog</a> web statistics. After playing with both, I decided to use AWStats.]]></description>
			<content:encoded><![CDATA[<p>Since I am running this blog on my own server, I decided I should probably set up some log parsing. My <a href="http://www.zacintosh.com/">personal website</a> is hosted by <a href="http://www.nearlyfreespeech.net/">Nearly Free Speech</a>, and they provide <a href="http://awstats.sourceforge.net/">AWStats</a> for statistics. Another <a href="http://www.twincitiestec.org/">site</a> I administer is hosted by <a href="http://www.dreamhost.com/">DreamHost</a>. DreamHost provides <a href="http://www.analog.cx/">Analog</a> web statistics. After playing with both, I decided to use AWStats.</p>
<p>Ubuntu Tutorials has provided a nice <a href="http://ubuntu-tutorials.com/2008/01/16/configuring-awstats-on-ubuntu-server/">tutorial</a> about setting up AWStats on Ubuntu. I configured my sites individually with no default site in the following files:</p>
<pre>/etc/awstats/awstats.blog.lundscape.com.conf
/etc/awstats/awstats.claude.zacintosh.com.conf
/etc/awstats/awstats.wiki.lundscape.com.conf</pre>
<p>This means that browsing to &#8220;http://domain.tld/awstats/awstats.pl&#8221; as they suggest won&#8217;t work. Instead, I append the site to the end of the string like this: &#8220;http://domain.tld/awstats/awstats.pl?config=blog.lundscape.com&#8221;.</p>
<p>Also, rather than adding entries to my crontab, I simply added a script to my &#8220;/etc/cron.hourly&#8221;:</p>
<pre>#! /bin/bash

/usr/lib/cgi-bin/awstats.pl -config=blog.lundscape.com \
	-update > /dev/null 2>&#038;1
/usr/lib/cgi-bin/awstats.pl -config=claude.zacintosh.com \
	-update > /dev/null 2>&#038;1
/usr/lib/cgi-bin/awstats.pl -config=wiki.lundscape.com \
	-update > /dev/null 2>&#038;1</pre>
<p>This automatically updates my AWStats every hour whether I view my statistics in a web browser or not.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.lundscape.com/2009/02/awstats-on-ubuntu-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
