I'm running Win32 (2000) on my server with PHP, Apache and MySQL (Linux is a jungle for me, so this was the way of getting the server up and running fairly easy).

How do I easiest make some Cron like scheduler in that environment?

Comments

Steven’s picture

I had a similar problem, and my solution was to set up a scheduled task that calls the commandline/cgi version of php to run a cron.php.
Windows' task scheduler is nasty though. You'll have to set up a daily job that repeats during 24 hours Only local images are allowed.. Obviously using minutes/hours/whatever was too complicated for MS.

moshe weitzman’s picture

If you are on the Schedule tab for a scheduled task (right click on a task to get there), you see a button called Advanced which leads to most of the tweaks you are used to.

If you only use the Scheduled Task Wizard you would never see this.

I thought that you couldn't call cron.php via CLI because the environment vars aren't setup properly. Has that changed?

larsbrink@blogger.com’s picture

I didn't succeed in this since I use the module version (php4apache2.dll) for my installation. I was thinking a simple solution with a browser open on the server that had a refrech interval of xx seconds which loaded the same page all the time.

Something like putting this in a page and add the cron.php into:
meta HTTP-EQUIV="REFRESH" content="[sek]; url=http://www.xxxx.dk/cron_hack.php"

Steven’s picture

Actually I *was* referring to that dialog...

To make a task that repeats every 10 minutes, I have to:
- set it to start at 0:00
- set it to repeat every 10 minutes
- set it to do this during 24 hours (or up to 23:50)
- set it to do this every day

You don't think that's complicated? It's a daily job that repeats during 24 hours, like I said Only local images are allowed..

Anonymous’s picture

I much prefer Cygwin's cron job scheduler to Winblows's Task Scheduler.

In fact, I use Cygwin's daemons whenever possible: sshd, cron, and rsyncd work great.