Entity view (Content)

How To Set Scheduled Tasks in Windows Server 2008

By brandont
Jun. 27, 2011

Here at Appnovation, we usually deploy Drupal sites on Linux servers. Recently, however, one of our clients needed Drupal to run off a Windows 2008 server. I had to set up a cron job on a Windows 2008 Server for Drupal and came across two methods for setting up a Scheduled Task. 1. Using the GUI - Click on Start and then go to Administrative Tools, once there click the “Task Scheduler” item - Once the Task Scheduler opens, click “Create Basic Task” - Give the task a name and description and click next - On the Date and Time screen, click “One Time” so that this task gets enabled once. Click Next. - On the Action screen, click “start program” and browse to the Internet Explorer executable stored within Program Files. - Add an argument to the “Action” screen which is the url for the drupal site (example: www.example.com/cron.php) - Click “Finish” - Now your task will be added to the Task Scheduler but there are additional configuration options we still need to define. - Find the task we just created within the Task list and right click on it, select “Properties” - On the “General” tab, select the option “Run whether user is logged in or not” - Under triggers, select “Edit” on the “One Time” option we created earlier. Select “Repeat this Task” and choose “Every 1 Hour” or however frequently you want your cron to run. Then select “indefinitely” to allow this Task to run for ever. 2. Using command line - Open a command line terminal and enter:

schtasks /create /tn "Drupal Cron Job" /tr " “C:\Program Files\Internet Explorer\iexplore.exe http://www.example.com/cron.php" /sc hourly

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

Building Rich Internet Apps with Drupal & HTML5
Learn the power of combining Drupal + HTML5 + CSS3 + JS
Post Tags: