<?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>Andrew Beaton :: FAQ &#187; cron</title>
	<atom:link href="http://andrewbeaton.net/faq/tag/cron/feed/" rel="self" type="application/rss+xml" />
	<link>http://andrewbeaton.net/faq</link>
	<description>Tips from the world of a software developer</description>
	<lastBuildDate>Wed, 13 Jul 2011 17:03:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>Run a cron job every x seconds</title>
		<link>http://andrewbeaton.net/faq/2010/01/26/run-a-cron-job-every-x-seconds/</link>
		<comments>http://andrewbeaton.net/faq/2010/01/26/run-a-cron-job-every-x-seconds/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 19:38:57 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[cron job]]></category>
		<category><![CDATA[schedule]]></category>

		<guid isPermaLink="false">http://andrewbeaton.net/faq/?p=96</guid>
		<description><![CDATA[As most of you know, the smallest time a cron job can be configured to run is every minute. To run a script every 15 seconds for example, you could use the following: main cron job: * * * * * /path/to/wrapper.sh wrapper.sh: /path/to/script &#38; sleep 15 /path/to/script &#38; sleep 15 /path/to/script &#38; sleep 15 [...]]]></description>
			<content:encoded><![CDATA[<p>As most of you know, the smallest time a cron job can be configured to run is every minute.<br />
To run a script every 15 seconds for example, you could use the following:</p>
<p><strong>main cron job:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>wrapper.sh</pre></div></div>

<p><strong>wrapper.sh:</strong></p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>script <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">15</span>
<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>script <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">15</span>
<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>script <span style="color: #000000; font-weight: bold;">&amp;</span>
<span style="color: #c20cb9; font-weight: bold;">sleep</span> <span style="color: #000000;">15</span>
<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>script <span style="color: #000000; font-weight: bold;">&amp;</span></pre></div></div>

<p>If you can suggest any nicer alternatives to this example, please let me know. <img src='http://andrewbeaton.net/faq/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://andrewbeaton.net/faq/2010/01/26/run-a-cron-job-every-x-seconds/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

