I have used cron4j in a small project, it's like a more lightweight version of Quartz and fits nicely with Clojure: http://www.sauronsoftware.it/projects/cron4j/
Code example here: https://gist.github.com/388555 /Patrik On Jan 8, 8:37 pm, Trevor <tcr1...@gmail.com> wrote: > Thanks, everyone for all you help. > > I noticed a few questions I should answer. > > re: email option: I really just planned on sending a gmail to indicate > the job succeeded or failed. Being somewhat new to programming the > straightest path, for me, would be using clojure code (I'm not a > network guru, so for me it's grab a library and use use it). > > re: webapp status: The job I want to run is really 3 jobs bundled in > one (they need not all run, but they at least need to run sequentially > if they do). So when I see an email notifying the fail, I will use the > web app to determine if #1, #2 or #3 failed. If #1 failed, then I can > trigger 2 and 3. I want this to be a eyeball decision, not a > programmatic one. > > Really, I just don't like cron jobs. I'd rather stay with in clojure > if I can where I'm comfortable that I'm not somehow pooching the > system, plus it just seems like something a language ought to be able > to do. > > I noticed a point made about not having to deal with OS differences, > which while not an immediate problem for me, is still noteworthy. At > some point I'd like to distribute my code, and not leave that burden > to others. > > I'm leaning towards just building my own, testing it out (learn more > this way). > I looked at the function gaz, provided, but it didn't seem like what I > would implement, but I may end up there. If that fails I will probably > use quartz-scheduler. > > Once again - thank you for all the replies. > > On Jan 8, 6:14 am, Ken Wesson <kwess...@gmail.com> wrote: > > > > > On Sat, Jan 8, 2011 at 12:04 AM, Michael Gardner <gardne...@gmail.com> > > wrote: > > > On Jan 7, 2011, at 9:19 PM, Ken Wesson wrote: > > > >> On the other hand, running a job scheduler from outside Clojure > > >> results in cranking up a big, slow to start up, expensive JVM process > > >> every single time a task needs to run, each of which runs one task > > >> once, and the scheduling itself must be done in an icky language like > > >> shell or cron's idiosyncratic "crontab" files with icky error > > >> reporting (e.g., need to run a local mail *server* to receive error > > >> notifications). > > > > If you care about startup times, you can use nailgun. But that shouldn't > > > matter unless you're running the job every minute or something. > > > Obviously, that requires knowing about, and learning how to use, > > nailgun. Solutions with a higher cost in > > novel-tools-you-have-to-figure-out-how-to-use are not, all other > > things being equal, superior ones. > > > > As for scheduling, crontabs are really not hard to figure out. If you > > > need more complex scheduling, you can do that from your Clojure script > > > (essentially using cron to set the polling interval). > > > If you're going to do that anyway, you might as well do the whole > > thing from inside Clojure. > > > > And what kinds of error reporting could you do from a persistent daemon > > > that you couldn't also do from a cron job? Besides, most > > > systems that have cron also come with postfix (though it's disabled by > > > default on Mac OS X), so all you have to do is add your email > > > address to /etc/aliases. Email-based error reporting for background tasks > > > is really nice because you don't have to remember to check > > > some log file or other task-specific status indicator periodically (which > > > has burned me in the past). > > > Well, both Windows and MacOS have variations on the nifty concept of > > "tray notification". > > > > But this is all somewhat beside the point. What Trevor said sounded as > > > though the specific types of tasks he mentioned (sending > > > emails and checking some kind of status via web app) were particularly > > > unsuited to scheduled jobs; I was asking what it was about > > > those tasks in particular that made him lean towards a daemon instead. > > > Maybe he needs timely responses to something, so something more akin > > to a web server than a periodically-run job? -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en