<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> 
<channel>
<title>CodeStore.net comments on "Scheduled Agents Equivalent in PHP"</title>
<description>Replies to blog "Scheduled Agents Equivalent in PHP" on codestore.net.</description>
<link>http://www.codestore.net/</link>
<lastBuildDate>Sat, 13 Dec 2008 12:22:41 -0600</lastBuildDate>
<atom:link href="http://www.codestore.net/store.nsf/blog.xml?Open=20081211" rel="self" type="application/rss+xml" />

<item>
	<title>Reply from Jerry Carter</title>
	<pubDate>Sat, 13 Dec 2008 12:22:41 -0600</pubDate>
	<author>Jerry Carter</author>
	<description><![CDATA[ 
		<p>Glad to see you on this topic Jake, as I've been working to learn the basics myself as of late.  </p>
		<p>Roughly, when you schedule a Notes Agent in a database on the server, a request is made to the scheduler which then schedules the agent to run.  </p>
		<p>It would seem like building a package that gave a similar functionality via PHP wouldn't be terribly difficult - I would assume phpjobscheduler does something like this.  I'd probably start by creating my own admin mysql database with the parts I'd want for keeping track of agents and other tasks that come up... such as logging (or better to have a log database like Notes has separate log and admin request dbs).  I think the pattern used by Domino is terrific - and the fact that it's prepackaged for us makes it an easy way to go.  If you have to do the same in PHP, it seems like the ideal model to emulate.  Effectively, cron would take the role of your domino server task scheduler - all logic would be controlled by your database using sh or php to access it.</p>
		<p>Btw, jake, if you're learning php entangled with cron, learn shell scripting as well.  Many wonderful things there.  Wrox has a good "Beginning Shell Scripting" book.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=0BFD4CA6576376118625751E0064F3E9"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20081211?OpenDocument#DOC_0BFD4CA6</link>
</item><item>
	<title>Reply from veer</title>
	<pubDate>Fri, 12 Dec 2008 07:50:32 -0600</pubDate>
	<author>veer</author>
	<description><![CDATA[ 
		<p>Jake,</p>
		<p>Let me first say that I don't know MySQL. :-)</p>
		<p>I'm sure MySQL would not do everything PHP does, however the idea was that if it allows you to schedule jobs you could make URL requests to php. </p>
		<p>In essence, MySQL will be your job scheduler which could run stored procs or external calls.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=D4C317E6FD09E4568625751D004C09A9"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20081211?OpenDocument#DOC_D4C317E6</link>
</item><item>
	<title>Reply from Yogi</title>
	<pubDate>Fri, 12 Dec 2008 00:59:21 -0600</pubDate>
	<author>Yogi</author>
	<description><![CDATA[ 
		<p>Why not running php-cli instead of relying on Apache ?</p>
		<p>Your PHP "agent" should be located outside the web server's root, for obvious security reasons (and therefore, no need for credentials).</p>
		<p>Finally, you may use "anacron" instead of "cron" to resolve the downtime issues. It comes with most of the distributions.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=D5377BF386DFCDEE8625751D00266453"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20081211?OpenDocument#DOC_D5377BF3</link>
</item><item>
	<title>Reply from Ferdy Christant</title>
	<pubDate>Thu, 11 Dec 2008 15:49:01 -0600</pubDate>
	<author>Ferdy Christant</author>
	<description><![CDATA[ 
		<p>Good point, Jake. Scheduled agents is also one of the things I miss outside Domino, even in .NET you have the same issue as with PHP (although it's not a cron but a service or scheduled task at OS level). </p>
		<p>Over a year ago, I wrote an article that covers a lot of aspects that you would miss outside Domino:</p>
		<p>http://ferdychristant.com/blog/archive/DOMM-6YGCFQ</p>
		<p>Although it's a bit old, it may be a nice way to remember that Domino isn't that bad after all.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=618F8C625C89D5C78625751C0077D80E"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20081211?OpenDocument#DOC_618F8C62</link>
</item><item>
	<title>Reply from Jake Howlett</title>
	<pubDate>Thu, 11 Dec 2008 15:10:57 -0600</pubDate>
	<author>Jake Howlett</author>
	<description><![CDATA[ 
		<p>veer. So, MySQL can do anything the PHP script can do? I keep meaning to look in to stored procedures. Will do now.</p>
		<p>Thanks for the advice Gareth. I'll remember anacron if there's a next time, which I hope there will be. By the way, glad you (and other now non-Dominoers) are still reading. </p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=CDA4557FD97556AC8625751C00745BE6"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20081211?OpenDocument#DOC_CDA4557F</link>
</item><item>
	<title>Reply from Gareth Hay</title>
	<pubDate>Thu, 11 Dec 2008 13:13:28 -0600</pubDate>
	<author>Gareth Hay</author>
	<description><![CDATA[ 
		<p>It's been a long time since I commented as I've been out of Notes development for a long time.</p>
		<p>Now to the point in hand - cron.</p>
		<p>You can use anacron which never assumes that the computer is running 24/7 and will execute scripts the next time it is able to do so. (If you happen to have a Darwin host, launchd should also be available for your use)</p>
		<p>You can however invoke a php script as a shell executable, with this in mind, you can write a php script to have a while(1) loop which performs tasks only at set times and sleeps the rest of the time. That can be started by a php management script (from the web if you want) to start and stop it.</p>
		<p>Although not simple, you should be able to knock something up fairly quickly and maintain the "bundled" feel to your code. (If it's too difficult a quick Google does show "http://www.phpjobscheduler.co.uk/" - no idea how well it works as I've never used it - I wrote my own)</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=6863A0F406EBCB5D8625751C00699A15"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20081211?OpenDocument#DOC_6863A0F4</link>
</item><item>
	<title>Reply from mdmadph</title>
	<pubDate>Thu, 11 Dec 2008 12:38:53 -0600</pubDate>
	<author>mdmadph</author>
	<description><![CDATA[ 
		<p>And it's reasons like these that, after working with them all, I still prefer notes.  Let the detractors say what they want, but it sure does make managing server-side stuff _easy_.</p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=FF328A0A8CA6C75B8625751C00666FCF"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20081211?OpenDocument#DOC_FF328A0A</link>
</item><item>
	<title>Reply from veer</title>
	<pubDate>Thu, 11 Dec 2008 11:46:00 -0600</pubDate>
	<author>veer</author>
	<description><![CDATA[ 
		<p>Jake,</p>
		<p>Isn't it the right way to do a stored procedure and put it on your database machine instead of typing it to php?</p>
		<p>After all, your data should be manipulating data or send emails which most back ends do. </p>

		<p><a href="http://www.codestore.net/store.nsf/reply?OpenForm&ParentUNID=BD207B6AA4514E1B8625751C00619882"><img border="0" src="http://www.codestore.net/store.nsf/images/rss_reply.gif" alt="Click here to post a response" /></a></p>
	]]></description>
	<link>http://www.codestore.net/store.nsf/unid/BLOG-20081211?OpenDocument#DOC_BD207B6A</link>
</item>

</channel>
</rss> 
