How to run cron on Windows based Servers?

(XerraX) #1

Is there a php file for running cron on windows based servers? Or something else?

(Matthieu Aubry) #2

see for creating windows tasks

(XerraX) #3

ok but there is no cron.php? just a .sh file

(XerraX) #4


(dohtor) #5

[quote=XerraX @ Jun 25 2009, 12:17 PM]To setup a Windows machine to run cron.php at a specific time follow the specific instructions below. This can be useful if you are not familiar with Linux/Unix, or if your web host does not offer the ability to run cron jobs; you can run them remotely from your own computer.

Note: These instructions were written for Windows XP but should be similar in other versions of Windows.

Creating a Scheduled Task

  1. Open Scheduler
  2. Go to Start > Programs > Accessories > System Tools > Scheduled Tasks
  3. Double-click Add Scheduled Task
  4. The Scheduled Task Wizard will appear. Click Next.
  5. Select the program to run. Choose your browser from the list (for example, Internet Explorer or Mozilla Firefox). Click Next.
  6. Give the task a Name, such as Drupal Cron Job, and choose the Frequency with which to perform the task (for example, Daily)). Click Next.
  7. Choose specific date and time options (this step will vary, depending on the option selected in the previous step). When finished, click Next.
  8. Enter your password if prompted. Change the username if required (for example, you’d like the task to run under a user with fewer privileges security reasons). Click Next.
  9. On the final page, select the checkbox Open advanced properties for this task when I click Finish and click Finish.

Configuring the task

  1. Go to the task’s setting page either by checking the checkbox at the end of the last step, or by double-clicking on the task.
  2. In the Run box, after the text that is there now (for example, C:\PROGRA~1\MOZILL~1\firefox.exe), enter a space and then type the address to your website’s cron.php page in double quotations (for example, C:\PROGRA~1\MOZILL~1\firefox.exe
  3. To set a frequency more often than Daily (for example, hourly), click the Schedule tab, then click Advanced. Here you can set options such as Repeat task, every 1 hour for 23 hours. Click Ok when finished.
  4. Change the start time on the task to one minute from the current time. This will allow you to test the task and make sure that it is working.
  5. When all settings have been configured to your liking, click Apply and OK (note: you may be prompted for your password)[/quote]

And one more link “how to run .sh file in Windows

(XerraX) #6

It is an epic fail if users with windows servers have to emulate shells for running linux files. The coders could easily make a cron.php that could be used on almost every OS!

I will revert to Google Analytics because no body is helping. And the devs doesnt seem to care about Forums.

My Question was NOT how to create Windows tasks!
My Question was NOT how to run .sh files on Windows!
Your Question:
"Can you create a new php file on your host?"
is absolutly stupid! How else would i use piwik?

(vipsoft) #7

Please watch your tone.

Just so you know, I don’t get paid to work on Piwik, either coding or responding in the forums.

There’s a ticket in trac to add archiving to the API. With that, you should be able to modify one of the API examples in the misc folder to call the API using a pure php script. The alternative is to wait until we’ve cleared more pressing issues off our collective plates.

I’d offer more instructions, but I’m posting from my phone.

(Matthieu Aubry) #8

please look at:
there is a plugin attached that should run archivnig automatically for all your websites - we want to make it a bit better before including it in core and maybe replace the crontab