Configuring Cron Jobs on Windows the right way.

Configuring Cron Jobs on Windows the right way.

What the hell is a cron job?

cron is a Linux utility which schedules a command or script on your server to run automatically at a specified time and date. A cron job is the scheduled task itself. Cron jobs can be very useful to automate repetitive tasks and it can highly automate your day to day tasks. Many peoples wanted to have CRON deployed on Windows based web-servers.

lets have a cron configured on windows.

Because CRON is not availble on Windows, but many peoples have achieved it via installing cygwin. But on Windows you can use Scheduled Tasks. 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.

 

ADDING A SCHEDULE JOB.

A schedule job is what we call a CRON on windows. On a Windows Machine:

  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 this 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:\Program Files (x86)\Google\Chrome\Application\chrome.exe), enter a space and then type the address of your website’s cron.php page in double quotations (for example, C:\Program Files (x86)\Google\Chrome\Application\chrome.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 2 hour for 23 hours. Click Ok,when finished.
  4. Change the start time on the task to one minute of 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)

Make sure to enter valid Chrome path, if you are unsure than try to use google to determine where the Google Chrome is installed on your Computer.

Good Luck!

 

As rated by readers
[Total: 0 Average: 0]
0

Leave a Reply

avatar
  Subscribe  
Notify of