On Tue, Aug 15, 2006 at 03:48:55PM -0700, John Buckman wrote: > Anyone have any advice on how to run tasks on a scheduled basis > within the aolserver process? > > Currently, I use cron to run "lynx http://bookmooch.com/ > nightlyjobs.adp", and that works fine, but was wondering if there was > an all-aolserver way, that was more elegant.
The 3 ns_schedule_* commands, which are useful and mostly work fine: http://panoptic.com/wiki/aolserver/Ns_schedule_proc Whether those are more elegant than crontab is open to debate, but they are similar in power. Substantially more powerful scheduler systems should certainly be feasible, but when I looked back in January (see below) I couldn't find any, and it hasn't been important enough for me to do the R&D to build own myself. But in case you're curious... http://sourceforge.net/mailarchive/forum.php?thread_id=9580044&forum_id=45522 http://www.ps.uni-sb.de/pipermail/mozart-users/2005/013959.html There are apparently dozens of forward and/or backward chaining "rule engines" I wasn't aware of then, e.g.: http://www.manageability.org/blog/stuff/rule_engines/view http://en.wikipedia.org/wiki/Business_rules_engine However, it's not clear that any of those would actually be much use for building the sort of super-crontab tool or language extension I mention in use case #1 below. A forward chaining rule engine doesn't look intrinsically hard, I suspect most of the effort in developing a good super-crontab would lie elsewhere. ----- Forwarded message from Andrew Piskorski <[EMAIL PROTECTED]> ----- From: Andrew Piskorski <[EMAIL PROTECTED]> Date: Fri, 27 Jan 2006 16:55:20 -0500 To: [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] Subject: rule systems for crontab and active databases? First of all, please note the cross-posting above. I believe it is appropriate in this case, as my questions apply equally to CLIPS, Lisa, and Soar. I am interested in the use of forward-chaining rule systems in non-AI systems, particularly for "active databases". The two use cases I particularly have in mind are: 1. A much more powerful cron/crontab scheduler replacement. 2. Rich business rules which respond automatically to real-time financial market data. First I'll list some questions for you folks, then go on to discuss the the two use cases which inspired them: How well does your system respond to rapidly changing facts? Can it change its rules on the fly? Will it still perform adequately if the rules change rapidly? Any useful rules of thumb for just how MUCH changing of facts and/or rules your system can support? Is there a good way to make your system time-aware, like cron is? How would you do it? Do you know of anyone implementing a more powerful crontab-like system before? If not, how would you recommend that someone go about doing so? Do you think your forward-chaining rule system tools suitable for this use? Why or why not? Do you implement any forward-chaining algorithms other than Rete, e.g., Leaps, Treat, or Rete* ? Why or why not? Any other systems I should look at that I've missed? And finally, what are the fundamental similarities and differences between your systems and others, and when and why are these significant? Why would someone choose to CLIPS vs. Lisa vs. Soar? Now, the use cases: 1. A much more powerful cron/crontab scheduler replacement: On Unix, the cron daemon and crontab files are the typical tool for scheduling jobs to run periodically or at particular times. This is useful, but woefully limited in its expressive power. What I really want instead, is some tool which, via a programming language, can express dependencies and constraints between scheduled jobs, integrates tracking of and actions on job success or failure, etc. E.g., "Run job A immediately after both jobs B and C successfully finish. If job A fails, run job X. Run job D at the first Monday of each month, at these times throughout the day..." It seems to me that a forward chaining rule system should be suitable for building such a smart cron system, *IF* (among other things) it has a good way to model and react to the passage of time. However, so far I haven't been able to find any info about modeling time and constraints in such environments, nor any examples of a more powerful crontab-like system using such tools. 2. Business rules which respond automatically to real-time financial market data: I am interested in taking real-time financial market data (e.g., prices of securities) and filtering them through business rules which trigger arbitrary actions - trade execution, alerts, changes in the rules, whatever. Years ago, as part of a larger project, my team actually did implement a simple version of that. Fortunately we were only dealing with a modest amount of streaming data (selected bond index options), so we simply stuffed all the data it into our Oracle database as it arrived and then fired triggers based on the data. That is not a generally useful solution. It probably would have had severe performance problems with larger amounts of or faster incoming data. Just as bad, RDBMS triggers (in Oracle, PostgreSQL, etc.) have lots of drawback and limitations, and do NOT provide a very good language substrate for this kind of job. E.g., it would be very, very nice to allow sophisticated end users to define their own rule-based triggers, but our old Oracle trigger system CERTAINLY could not support that. We could only offer certain pre-defined canned rules ("If option price X moves by more than Y%, suspend all my pending orders!"), and even then we had to carefully pick what rules to implement so as not to run afoul of recursive trigger problems and other limitations. 3. Finally, here are some additional links which may be of interest: These old threads give some links related to the financial market use case for forward-chaining systems, etc.: http://openacs.org/forums/message-view?message_id=44805 http://openacs.org/forums/message-view?message_id=113190 Various cron systems - AFAIK none of these do what I want: http://fcron.free.fr/ http://www.gentoo.org/doc/en/cron-guide.xml http://saturn.sourceforge.net/about.php Some daemon launcher tools - even more limited than the cron systems above: http://cr.yp.to/daemontools.html http://arstechnica.com/reviews/os/macosx-10.4.ars/5 http://developer.apple.com/documentation/Darwin/Reference/ManPages/man8/launchd.8.html Other projects (some of them very old or defunct) which are more or less related include Aditi, Venus-DB, Mozart/Oz, Mercury, and of course various Prolog systems: http://www.cs.mu.oz.au/research/aditi/ http://www.cs.mu.oz.au/research/mercury/ http://www.cs.utexas.edu/users/venus/ http://www.cs.utexas.edu/users/miranker/treator.htm http://www.mozart-oz.org/ http://www.cise.ufl.edu/~sharma/research/active.html http://itlab.uta.edu/sharma/Projects/Active/index.htm Thanks for your time and input! -- Andrew Piskorski <[EMAIL PROTECTED]> http://www.piskorski.com/ ----- End forwarded message ----- -- Andrew Piskorski <[EMAIL PROTECTED]> http://www.piskorski.com/ -- AOLserver - http://www.aolserver.com/ To Remove yourself from this list, simply send an email to <[EMAIL PROTECTED]> with the body of "SIGNOFF AOLSERVER" in the email message. You can leave the Subject: field of your email blank.
