[pmwiki-users] Cron question (was Newsletter throttling)

Ian Barton lists at manor-farm.org
Mon Oct 30 03:33:23 CST 2006


There are at least two way of doing it. You can use the command line 
version of php (also known as the cgi version) to execute your code 
directly:

/path_to_php/php.cgi yourscript.php

Note that the command line version may not be called php.cgi and not all 
ISP's make it available.

The second way is to use something like wget to call your web page:

/path_to_wget/wget http://www.yoursite.com/yourscript.php

wget is installed on most *nix like systems and is basically a utility 
for non-interactive downloading of files via http. However, there is 
nothing to stop you using it as a general purpose script to execute web 
pages.

Ian.

> OK!  I have my newsletter functions sketched out, and I'm leaning
> towards cron.  I've discovered how to set up an action.  Very simple
> question though:
> 
> How do you write news.php so when cron calls the file it executes
> code.  Something like this, with direct commands?  Or do I have to put
> it in a web page and call the php. Or something else entirely.  First
> time I've ever done anything in php outside of pmwiki, and first time
> in cron.
> 
> <?php
> $var = "";
> DoStep("1");
> DoStep("2");
> ...
> 
> function DoStep($x) {
>      ...
>      }
> 





More information about the pmwiki-users mailing list