Xtremax - Web Design

22 Mar, 2009

Running a Cron Job in PHP

Posted by: Mr Otter In: Joomla

For a moderately sophisticated web application, you will generally have some tasks which you need to be run on a regular basis.  In Java you have the quartz framework.  In .NET, I hear they rely on the Windows Scheduler to schedule regular jobs.  How about Linux, PHP?  I am aware that we can probably do a wget in the crontab, but.. is there a better way?  Edward did mention something about drupal having some kind of cron implementation… so just wanted to dig a little deeper into that…

Well, hmmm.. turns out that drupal way… is basically just leveraging on the crontab.  Nothing new.  Relying totally on the OS scheduling mechanism.  :P

But found something quite interesting though… they call it a Poor Man’s Implementation of Cron.  Basically, it is treating each page view as a possible trigger point for scheduled jobs, since PHP codes are executed on each browser request.  Apparently both drupal and joomla has their own implementation.. but of course, it will not work for a more serious project like ours…

http://extensions.joomla.org/extensions/847/details

http://drupal.org/project/poormanscron

Bookmark and Share

2 Responses to "Running a Cron Job in PHP"

1 | nanny jobs

July 31st, 2009 at 7:59 am

Avatar

Nanny To You is a free nanny jobs search service

2 | Micheal4567

October 23rd, 2009 at 11:41 pm

Avatar

I just bookmarked this for my future referance.

Have a nice day
freanch
______________________________________________
aion gold | Cheap Aion kinah

Comment Form

Xtremax Web Design Portfolio

    Opera Estate Primary SchoolNational Association of Travel Agents SingaporeFUMIYAMA CORPORATIONEngineering Education PortalBOON HI-TECH SUPERSTORESingapore Tourism Board

About Xtremax

This is all about a group of hard-core web developers who go about rambling about their daily efforts to make the internet world a better and more accessible place.