<?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>Pass By Value &#187; cron</title>
	<atom:link href="http://passbyvalue.com/tag/cron/feed/" rel="self" type="application/rss+xml" />
	<link>http://passbyvalue.com</link>
	<description>... or is it pass by reference?</description>
	<lastBuildDate>Thu, 26 Jan 2012 03:09:41 +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>Setting up scheduled jobs with Rails</title>
		<link>http://passbyvalue.com/2009/06/setting-up-scheduled-jobs-with-rails/</link>
		<comments>http://passbyvalue.com/2009/06/setting-up-scheduled-jobs-with-rails/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 13:02:42 +0000</pubDate>
		<dc:creator>Trent</dc:creator>
				<category><![CDATA[Software development]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[svn]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://blog.passbyvalue.com/?p=3</guid>
		<description><![CDATA[I&#8217;ve seen lots of different approaches to scheduling jobs with Rails, including a great run down by Ryan Bates&#8217; Rails Casts Episode 129, however the most elegant solution I&#8217;ve seen so far is what was outlined in Episode 164 using the cool Whenever gem and good ol&#8217; Cron. Within a couple of hours I had [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve seen lots of different approaches to scheduling jobs with Rails, including a great run down by Ryan Bates&#8217; Rails Casts <a href="http://railscasts.com/episodes/129-custom-daemon">Episode 129</a>, however the most elegant solution I&#8217;ve seen so far is what was outlined in <a href="http://railscasts.com/episodes/164-cron-in-ruby">Episode 164</a> using the cool <a href="http://github.com/javan/whenever/tree/master">Whenever</a> gem and good ol&#8217; <a href="http://en.wikipedia.org/wiki/Cron">Cron</a>.</p>
<p>Within a couple of hours I had a weekly scheduled job running all nicely managed entirely through my Rails application code base.  The incorporation into Capistrano makes it killer.  The only thing that caught me out was that my script/runner file was not set as executable when capistrano was deploying it, therefore runner commands failed to execute through Cron with a &#8220;permission denied&#8221; error.</p>
<p>Found that all I needed to do was set it to executable within svn:</p>
<div class="codecolorer-container bash railscasts" 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;">svn propset</span> svn:executable on script<span style="color: #000000; font-weight: bold;">/</span>runner</div></div>
<p>All good!</p>
]]></content:encoded>
			<wfw:commentRss>http://passbyvalue.com/2009/06/setting-up-scheduled-jobs-with-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

