[Typo3-dev] Typo3 alternative to cron (?)

Peter Russ peter.russ at 4dfx.de
Thu Feb 24 04:59:02 CET 2005


Suman Debnath schrieb:
> Hi Everybody,
> 
> We are trying to build an extension where a process will check some 
> condition periodically and a mail should be sent out at depending upon 
> that. We donot want to use a cron. Does Typo3 (or any of its extensions) 
> has any built-in method to help here?
> 
> Thanks in advance,
> Suman Debnath
> 
> 
Contrary to my earlier post this could be realized with PHP only:

1) define a file similar to cron tab
2) create a script:
	1) checking that file
             do
	    	if condition meets call a starter script by URL
                 which initialize the cron execution
	    	this script has to finalize also if connection close
	    	(ignore_user_abort)
             on any entry
         2) sleeping some sec
         3) recall script by url


Example:
cron.php is the script for the timer
starter.php is the script to init execution
exec.php is the script to execute
all on my.domain.com

cron----
        I
        check cronfile?    Y   -> call 
fsockopen(http://my.domain.com/starter.php?job)
        I
        sleep
        I
        fsockopen(http://my.domain.com/starter.php?cron)


starter---
          I
          job?    Y -> call fsockopen(http://my.domain.com/exec.php?job)
  	 I
          cron?   Y -> call fsockopen(http://my.domain.com/cron.php)

for fsockopen time out should be set to 1 sec. Could be enough to 
initialize.

As this is just a rough draft there are some questions:
1) Should cron call the exec directly without starter?
2) How to initialize the script, i.e. when server starts or some real 
time out breaks the cycle
3) How much logging is requirred.
4) What can brake the cycle beside time out and how to fix.
5) Mechanism against DoS

IMHO this could work.

Comments highly appreciated.

Regs Peter.

P.S. Now I call my cron for an espresso.




More information about the TYPO3-dev mailing list