Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By larsbrink@blogger.com on
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
Task scheduler
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 . Obviously using minutes/hours/whatever was too complicated for MS.
correction: too complicated for UnConeD
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?
Tried to call cron.php from the CLI
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"
Actually
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 .
You could use Cygwin's cron
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.