IBEE Solutions Web Hosting Blog
 
  • Dedicated Hosting
  • Domain Names
  • Google Apps
  • IBEE Hosting Home
  • Web Hosting

Category Archives:

Windows servers

How to Configure Cron Jobs in Windows Servers?

Posted on  October 13, 2009  by  Betrand Yella

Categories: Microsoft, Web Hosting, Windows servers
Tags: cron job in windows servers, cron jobm windows servers

To configure or 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 http://www.example.com/cron.php
  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)

Command-line version

Another way to perform the above commands is by using the schtasks (or at in Windows 2000) command from the command line. To duplicate the example above, which runs Firefox hourly to execute http://www.example.com/cron.php, open a command prompt (Start > Programs > Accessories > Command Prompt) and enter:

schtasks /create /tn "Drupal Cron Job" /tr "C:\PROGRA~1\MOZILL~1\firefox.exe http://www.example.com/cron.php" /sc hourly

Enter your password if prompted.

Using wget for Windows to run cron

If for whatever reason you’d rather not deal with a browser window popping up on the machine, you can use wget, the Windows port of which works more or less the same as it does in UNIX. curl and lynx also have windows ports but wget is probably the easiest to set up and use.

Grab a copy of wget from your choice of either the author’s site or from SourceForge. Install it to the location of your choice.

Follow the steps for Creating A Scheduled Task above, except select wget.exe as the program to run (you may need to click the Browse button to locate it if you installed from a .zip file, for example). When you get to the Advanced Properties dialog, paste in the following after the program path:

-O - -q -t 1 http://www.example.com/cron.php

Adjust the rest of the options as described above and test it.

1 Comment
  • RSSRSS Feed
  • Categories

    • Blogging Tips (1)
    • Domain-Names (15)
    • General News (16)
    • Google (21)
    • Mobile Apps (4)
    • Offers and Promos (3)
    • Security (3)
    • SEO (32)
    • Social Media (3)
      • Facebook (3)
    • Web Design (9)
    • Web Development (4)
    • Web Hosting (39)
      • Control Panels (2)
      • Microsoft (5)
        • Windows servers (1)
    • Wordpress (1)
  • Tags

    blacklisted in google Corporate SEO CSS attacks Directory submission Domain-Names domain name domain registration expired domains free windows software FTP Google Apps Google browser Google Wave hosting company hosting packages hosting services Hostspark Host Spark IE Linux Hosting Microsoft Apps Microsoft webspark on-page restore MSSQL restore SQL database script injections Search engine optimization SEO SEO process SEO services SEO Strategy SQL 2005 SSRS Hosting templates unlimited hosting upload website Web Design webhost Webhosting Web Hosting website may harm in google search results webspark what is seo windows explorer XSS attacks
  • Archives

    • March 2013 (1)
    • January 2013 (1)
    • December 2011 (1)
    • July 2011 (1)
    • June 2011 (2)
    • April 2011 (3)
    • March 2011 (8)
    • February 2011 (2)
    • January 2011 (1)
    • December 2010 (3)
    • November 2010 (7)
    • October 2010 (1)
    • September 2010 (3)
    • August 2010 (2)
    • July 2010 (7)
    • June 2010 (4)
    • May 2010 (4)
    • April 2010 (4)
    • March 2010 (5)
    • February 2010 (7)
    • January 2010 (3)
    • December 2009 (4)
    • November 2009 (4)
    • October 2009 (3)
    • September 2009 (7)
    • January 2009 (1)
    • January 2008 (1)
    • December 2007 (28)
  • Resources

    • Cloud Computing
    • Free Anti Malware tool
    • Geeks From India
    • Google Apps
    • Telugu and Hindi Songs
Copyrights © 2010. All Rights Reserved.
IBEE Solutions