Re: cron for mod_perl?

2001-03-03 Thread Les Mikesell
From: Matt Sergeant [EMAIL PROTECTED] On Thu, 15 Feb 2001, Perrin Harkins wrote: Maybe we should add process scheduling into Apache, and a file system, and a window manager, and... Perhaps its the difference between people who've had to write shrink-wrap apps? The question for me is

Re: cron for mod_perl?

2001-02-15 Thread Ask Bjoern Hansen
On Wed, 14 Feb 2001, Perrin Harkins wrote: On Wed, 14 Feb 2001, Pierre Phaneuf wrote: I guess two persons "simpler" aren't always the same: I find it easier laying out a table and querying it than hacking something to fiddle with my crontab safely. As far as I know, crontab -e is

Re: cron for mod_perl?

2001-02-15 Thread Matt Sergeant
On Thu, 15 Feb 2001, Ask Bjoern Hansen wrote: On Wed, 14 Feb 2001, Perrin Harkins wrote: On Wed, 14 Feb 2001, Pierre Phaneuf wrote: I guess two persons "simpler" aren't always the same: I find it easier laying out a table and querying it than hacking something to fiddle with my

Re: cron for mod_perl?

2001-02-15 Thread Pierre Phaneuf
Ask Bjoern Hansen wrote: So: What is the task at hand (more than "run something at certain intervals" (which is what cron(8) is for)). I am building a web something-something (I don't know what's the current buzzword for that, you know, the big integrated things) similar to the ArsDigita

Re: cron for mod_perl?

2001-02-15 Thread Pierre Phaneuf
Ask Bjoern Hansen wrote: I guess two persons "simpler" aren't always the same: I find it easier laying out a table and querying it than hacking something to fiddle with my crontab safely. As far as I know, crontab -e is perfectly safe. "crontab -l | foo" and "foo | crontab -" are

Re: cron for mod_perl?

2001-02-15 Thread Pierre Phaneuf
Matt Sergeant wrote: as for putting cron into Apache: I don't understand why that's wanted in the first place. When connecting to the database outside the httpd it doesn't matter if it goes a little slow. And having separate programs to do the maintenance would easily be much simpler

Re: cron for mod_perl?

2001-02-15 Thread Stas Bekman
On Thu, 15 Feb 2001, Pierre Phaneuf wrote: Ask Bjoern Hansen wrote: I guess two persons "simpler" aren't always the same: I find it easier laying out a table and querying it than hacking something to fiddle with my crontab safely. As far as I know, crontab -e is perfectly

Re: cron for mod_perl?

2001-02-15 Thread Tim Bunce
On Thu, Feb 15, 2001 at 09:04:43AM -0500, Pierre Phaneuf wrote: Apache::Schedule let you register callbacks (per Apache child process) that will be called after a given amount of time has passed, either once or repeatedly. Callbacks will be called at the next request after the required

Re: cron for mod_perl?

2001-02-15 Thread Pierre Phaneuf
Stas Bekman wrote: I might be barking at the wrong tree, but why cron? Why don't you use at(1). you don't need to parse crontab for that, and you can spawn processes with whatever intervals on demand. basically you can call at(1) itself at the end of at() so you can do the same as crontab.

Re: cron for mod_perl?

2001-02-15 Thread Pierre Phaneuf
Tim Bunce wrote: Apache::Schedule let you register callbacks (per Apache child process) that will be called after a given amount of time has passed, either once or repeatedly. Callbacks will be called at the next request after the required time, or at child exit time. Would it work

Re: cron for mod_perl?

2001-02-15 Thread Vivek Khera
"PP" == Pierre Phaneuf [EMAIL PROTECTED] writes: As far as I know, crontab -e is perfectly safe. "crontab -l | foo" and "foo | crontab -" are your friends. PP Ah yes. The problem with this is between the "crontab -l" and the PP "crontab -". You have to parse the crontab, find your own

Re: cron for mod_perl?

2001-02-15 Thread Perrin Harkins
On Thu, 15 Feb 2001, Stas Bekman wrote: I might be barking at the wrong tree, but why cron? Why don't you use at(1). And there's a CPAN module for it: Schedule::At. It claims to be cross-platform, and I believe NT has a version of at(1). - Perrin

Re: cron for mod_perl?

2001-02-15 Thread Pierre Phaneuf
Vivek Khera wrote: PP Ah yes. The problem with this is between the "crontab -l" and the PP "crontab -". You have to parse the crontab, find your own entry without Very limited thinking going on here. The crontab program honors the EDITOR environment variable. Now... setenv

Re: cron for mod_perl?

2001-02-15 Thread Perrin Harkins
On Thu, 15 Feb 2001, Matt Sergeant wrote: Its just a convenience thing. I've wanted to be able to do this too, for example to have emails go off at a particular interval. So yes, it can be done as cron + URI, but I'm just jealous of AOLServer's ability to do it all in one. This is especially

Re: cron for mod_perl?

2001-02-15 Thread Vivek Khera
"PP" == Pierre Phaneuf [EMAIL PROTECTED] writes: With appropriate Perl modules for the cron files, this should be trivial. But then, you probably aren't doing this from mod_perl... PP Well, yes, why? :-) You really want to have your web server writing files that execute arbitrary programs

Re: cron for mod_perl?

2001-02-15 Thread Matt Sergeant
On Thu, 15 Feb 2001, Perrin Harkins wrote: Maybe we should add process scheduling into Apache, and a file system, and a window manager, and... :-) Okay, I'm being silly, and there are times when duplication is necessary, but cron is such a well-established way of solving this problem that

Re: cron for mod_perl?

2001-02-15 Thread Pierre Phaneuf
be simply an Apache::Cron module or something like that, to ease the task of add/modifying/removing cron jobs from mod_perl, I agree. -- "As usual, this being a 1.3.x release, I haven't even compiled this kernel yet. So if it works, you should be doubly impressed." -- Linus Torvalds

Re: cron for mod_perl?

2001-02-15 Thread Pierre Phaneuf
Vivek Khera wrote: With appropriate Perl modules for the cron files, this should be trivial. But then, you probably aren't doing this from mod_perl... PP Well, yes, why? :-) You really want to have your web server writing files that execute arbitrary programs at arbitrary times?

Re: cron for mod_perl?

2001-02-14 Thread Pierre Phaneuf
Perrin Harkins wrote: Well, if I call the "check for things to do" URI every minute, then I'll be just fine. Many times, I'll just check and find nothing to do Huh? Why would you call it if there's nothing to do? Are you thinking you'll write a cron-ish task/timing spec for your Perl

Re: cron for mod_perl?

2001-02-14 Thread Perrin Harkins
Huh? Why would you call it if there's nothing to do? Are you thinking you'll write a cron-ish task/timing spec for your Perl app and just use the cron triggers as a constant clock? Yes, exactly. My plan is to have a table with the tasks in my database, and check expired tasks in a

Re: cron for mod_perl?

2001-02-14 Thread Pierre Phaneuf
Perrin Harkins wrote: Yes, exactly. My plan is to have a table with the tasks in my database, and check expired tasks in a cleanup handler. I'll have to lock the table, so that only one process does that. I'll also query the database only every so often, not at every request cleanup.

Re: cron for mod_perl?

2001-02-14 Thread Pierre Phaneuf
Perrin Harkins wrote: Sure, but why waste resources? Because it's easy? :-) As for the simplicity, having multiple individual custom cron jobs is simpler than one single generic cron job? Yes, much simpler, at least for the scheduling and dispatching part. Instead of designing

Re: cron for mod_perl?

2001-02-14 Thread Perrin Harkins
On Wed, 14 Feb 2001, Pierre Phaneuf wrote: I guess two persons "simpler" aren't always the same: I find it easier laying out a table and querying it than hacking something to fiddle with my crontab safely. As far as I know, crontab -e is perfectly safe. - Perrin

Re: cron for mod_perl?

2001-02-14 Thread Robert Landrum
Perhaps I've missed something, but in all this discussion no one has asked what it is you're trying to do. All I know is that you want to schedule something in a database and then check that database every minute (or so) and process the scheduled somethings. Generally speaking, 'at' is the

cron for mod_perl?

2001-02-13 Thread Pierre Phaneuf
Is there a way to have a Perl function called at some point in time, like I think AOLserver can do in Tcl (but I don't want to do either AOLserver or Tcl!)? I thought about checking the time in a PerlCleanupHandler, but this would be in each Apache subprocess and I want this to get called only

Re: cron for mod_perl?

2001-02-13 Thread Matt Sergeant
On Tue, 13 Feb 2001, Pierre Phaneuf wrote: Is there a way to have a Perl function called at some point in time, like I think AOLserver can do in Tcl (but I don't want to do either AOLserver or Tcl!)? I thought about checking the time in a PerlCleanupHandler, but this would be in each

Re: cron for mod_perl?

2001-02-13 Thread Vivek Khera
"PP" == Pierre Phaneuf [EMAIL PROTECTED] writes: PP Is there a way to have a Perl function called at some point in time, PP like I think AOLserver can do in Tcl (but I don't want to do either PP AOLserver or Tcl!)? Set up a handler and have a cron job "GET" the URL for it. You already have

Re: cron for mod_perl?

2001-02-13 Thread Pierre Phaneuf
Is there a way to have a Perl function called at some point in time, like I think AOLserver can do in Tcl (but I don't want to do either AOLserver or Tcl!)? I thought about checking the time in a PerlCleanupHandler, but this would be in each Apache subprocess and I want this to get

Re: cron for mod_perl?

2001-02-13 Thread Matt Sergeant
On Tue, 13 Feb 2001, Pierre Phaneuf wrote: Matt Sergeant wrote: Pretty much what you've already found out - Apache has no "cron" like daemon. One way you can do it is fork off a sub-process and run some sort of Cron perl module (I think there's a Cron module on CPAN, or you can run

Re: cron for mod_perl?

2001-02-13 Thread Pierre Phaneuf
Matt Sergeant wrote: Isn't forking off from Apache rather nasty? I saw something to that effect somewhere in the eagle book and on some web pages, but I think there are ways to do that without causing problems. Yes, its a pain. I suggest using the ways detailed below. My only problem

Re: cron for mod_perl?

2001-02-13 Thread Perrin Harkins
On Tue, 13 Feb 2001, Pierre Phaneuf wrote: Well, if I call the "check for things to do" URI every minute, then I'll be just fine. Many times, I'll just check and find nothing to do Huh? Why would you call it if there's nothing to do? Are you thinking you'll write a cron-ish task/timing spec