<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: Watch out for your CRON jobs</title>
	<atom:link href="http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/</link>
	<description>Everything about MySQL Performance</description>
	<lastBuildDate>Thu, 29 Jul 2010 19:06:57 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=13</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: XCondE</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-668481</link>
		<dc:creator>XCondE</dc:creator>
		<pubDate>Sat, 24 Oct 2009 08:32:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-668481</guid>
		<description>man 1 flock
       flock [-sxon] [-w timeout] lockfile [-c] command...

*/5 * * * * flock -xn /var/lock/mylockfile -c my-shell-script.sh

Only one will ever run.  You can also tell it to wait instead of bailing out:

*/5 * * * * flock -x /var/lock/mylockfile -c my-shell-script.sh

Or wait only 30 secs:

*/5 * * * * flock -x -w 30 /var/lock/mylockfile -c my-shell-script.sh</description>
		<content:encoded><![CDATA[<p>man 1 flock<br />
       flock [-sxon] [-w timeout] lockfile [-c] command&#8230;</p>
<p>*/5 * * * * flock -xn /var/lock/mylockfile -c my-shell-script.sh</p>
<p>Only one will ever run.  You can also tell it to wait instead of bailing out:</p>
<p>*/5 * * * * flock -x /var/lock/mylockfile -c my-shell-script.sh</p>
<p>Or wait only 30 secs:</p>
<p>*/5 * * * * flock -x -w 30 /var/lock/mylockfile -c my-shell-script.sh</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mikhail panchenko / blog &#187; Blog Archive &#187; &#8220;Watch out for your CRON jobs&#8221; @ MySQL Performance Blog</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-666749</link>
		<dc:creator>mikhail panchenko / blog &#187; Blog Archive &#187; &#8220;Watch out for your CRON jobs&#8221; @ MySQL Performance Blog</dc:creator>
		<pubDate>Tue, 20 Oct 2009 05:40:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-666749</guid>
		<description>[...] Watch out for your CRON jobs [...]</description>
		<content:encoded><![CDATA[<p>[...] Watch out for your CRON jobs [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sheeri K. Cabral</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-666535</link>
		<dc:creator>Sheeri K. Cabral</dc:creator>
		<pubDate>Mon, 19 Oct 2009 13:54:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-666535</guid>
		<description>Peter, 

Many people have shell/perl/php/python/ruby scripts that are cron jobs that only do database reads/writes, and can be converted to MySQL Events.  

Obviously if there are actions outside MySQL, it&#039;s not useful as a MySQL Event.

Pythian actually mitigates this issue by monitoring long-running OS processes.</description>
		<content:encoded><![CDATA[<p>Peter, </p>
<p>Many people have shell/perl/php/python/ruby scripts that are cron jobs that only do database reads/writes, and can be converted to MySQL Events.  </p>
<p>Obviously if there are actions outside MySQL, it&#8217;s not useful as a MySQL Event.</p>
<p>Pythian actually mitigates this issue by monitoring long-running OS processes.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Fourat</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-666331</link>
		<dc:creator>Fourat</dc:creator>
		<pubDate>Sun, 18 Oct 2009 23:59:55 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-666331</guid>
		<description>A more secure way to lock/unlock your script is to use register_shutdown_function() at the begin to register the action to be done on the end.</description>
		<content:encoded><![CDATA[<p>A more secure way to lock/unlock your script is to use register_shutdown_function() at the begin to register the action to be done on the end.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: The CRONs task &#124; Ansermot.ch</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-666206</link>
		<dc:creator>The CRONs task &#124; Ansermot.ch</dc:creator>
		<pubDate>Sun, 18 Oct 2009 11:27:45 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-666206</guid>
		<description>[...] the post   Share and [...]</description>
		<content:encoded><![CDATA[<p>[...] the post   Share and [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-665842</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Sat, 17 Oct 2009 03:16:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-665842</guid>
		<description>Sheeri,

I am mainly speaking about shell/perl/php/python/ruby scripts a lot of systems are running. If you just need simple query/stored procedure run you can use MySQL events of course.</description>
		<content:encoded><![CDATA[<p>Sheeri,</p>
<p>I am mainly speaking about shell/perl/php/python/ruby scripts a lot of systems are running. If you just need simple query/stored procedure run you can use MySQL events of course.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sheeri K. Cabral</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-665770</link>
		<dc:creator>Sheeri K. Cabral</dc:creator>
		<pubDate>Fri, 16 Oct 2009 22:40:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-665770</guid>
		<description>I&#039;m surprised you didn&#039;t recommend using MySQL events -- many people are on 5.0 or higher and can use them.  Errors are put into the error log (which I recommend monitoring, at Pythian we monitor error logs, and we can specify &#039;noise&#039; to ignore like if there&#039;s a lot of &quot;aborted connects&quot;, so we see the important things), so that issues is resolved.  

In fact, the times that the event started and finished are also logged in the error log, so there is a historical log of how long things take.</description>
		<content:encoded><![CDATA[<p>I&#8217;m surprised you didn&#8217;t recommend using MySQL events &#8212; many people are on 5.0 or higher and can use them.  Errors are put into the error log (which I recommend monitoring, at Pythian we monitor error logs, and we can specify &#8216;noise&#8217; to ignore like if there&#8217;s a lot of &#8220;aborted connects&#8221;, so we see the important things), so that issues is resolved.  </p>
<p>In fact, the times that the event started and finished are also logged in the error log, so there is a historical log of how long things take.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Watch out for your CRON jobs &#124; blog's amazing</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-665206</link>
		<dc:creator>Watch out for your CRON jobs &#124; blog's amazing</dc:creator>
		<pubDate>Thu, 15 Oct 2009 11:00:00 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-665206</guid>
		<description>[...] details and code sample in Watch out for your CRON jobs at MySQL Performance [...]</description>
		<content:encoded><![CDATA[<p>[...] details and code sample in Watch out for your CRON jobs at MySQL Performance [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-665129</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 15 Oct 2009 04:01:44 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-665129</guid>
		<description>Joy,

Yes. I see no problem with using semaphores if you prefer. I do not like it as much as it is harder to see the status of semaphores using command line tools.</description>
		<content:encoded><![CDATA[<p>Joy,</p>
<p>Yes. I see no problem with using semaphores if you prefer. I do not like it as much as it is harder to see the status of semaphores using command line tools.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: peter</title>
		<link>http://www.mysqlperformanceblog.com/2009/10/14/watch-out-for-your-cron-jobs/comment-page-1/#comment-665128</link>
		<dc:creator>peter</dc:creator>
		<pubDate>Thu, 15 Oct 2009 04:00:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.mysqlperformanceblog.com/?p=1410#comment-665128</guid>
		<description>Neven,

Right. There are possible issues. Though a lot of systems out there even at the large scale would run only one operation system or may be the couple. 

The GearMan is indeed great solution but I think it is overkill for a lot of simple tasks.</description>
		<content:encoded><![CDATA[<p>Neven,</p>
<p>Right. There are possible issues. Though a lot of systems out there even at the large scale would run only one operation system or may be the couple. </p>
<p>The GearMan is indeed great solution but I think it is overkill for a lot of simple tasks.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
