Is there a scheduler (cron like) module to fire off jobs?
Hello,
I want to start off by saying that I'm new to drupal and web programming in general. I have drupal 6 installed on a linux machine and I'm looking to implement a very basic service...
I would like to run a module (or the like) on a particular timing interval, say once an hour. Once the timer expires, I want to run a job/module that will ping a web server for some data and store the data on my drupal site. An example could be that once an hour, my module is invoked and grabs stock quotes for a list of stocks and stores them in my drupal database.
1. Does there exist a module that can run job(s) on a schedule?
2. Is there a module that pulls data from a generic web server?
Thanks in advance for your help!

To add a scheduled job inside
To add a scheduled job inside a custom module use hook_cron() hook. Define my_module_name_cron() function with code to retrieve and update stock quotes.
There is Supercron module that extends standard cron with advanced cron hooks managment (enable/disable particular task etc).
Hi Khorpyakov, Thank you for
Hi Khorpyakov,
Thank you for your reply. Is hook_cron() called at the same time cron.php is called? Can I configure my custom task to run more frequently?
Thank you.
hook_cron() is indeed called
hook_cron() is indeed called when cronjobs are run. You can set up cronjobs to run as often as you want, but it is a server setting, not a Drupal setting.
If you want a purely Drupal solution, you can use the poormanscron module. This acts like a cronjob, though there is a slight difference - it doesn't run automatically exactly at the time you want, rather, it runs on the first page access (by anyone) after the time that you set it to run. So if you want your cronjob to run on the hour (i.e. at :00 minutes every hour), it will run on the first page access after that. So if no one accesses your site between say 11:59 and 12:15, it will not run until 12:15.
So if you need precise timing, a cronjob is the way to go. But if you need mostly accurate timing, poormanscron is a good solution.
Do you have any experience
Do you have any experience with SuperCron or Elysia Cron? These seem to act like Poormans Cron as you described. Would you recommend one over the other?
Thanks.
Poormanscron launches cron
Poormanscron launches cron when users access your site... if you have a site with a LOT of traffic this could be used like you need .... but if you don't and you have a fine-grained crontab forget about it.
Poormancron is useful when you can't access a crontab... if you have a linux server this is not your case.
With elysia_cron you can have crontab-like scheduling configuration of each job.
From the topic:
what is difference between elysia cron and super cron?
For the list of differences see the rest of the message:
what is difference between elysia cron and super cron?
Thanks for your help. I'll
Thanks for your help. I'll have to play around with both to get a feel for which I prefer.