Alternative To Cron - Windows Scheduler

Tuesday, January 8th, 2008

I run a bunch of servers for my business. One , in particular, is better and more advanced than the others. Well, the isn’t more advanced, the installed on it is. On that , I am running Plesk, which I have learned is fantastic.

I recently began automating many of my more boring by using cron jobs. A “ is driven by a , a configuration file that specifies shell commands to run periodically on a given schedule.” Basically, if you have an that needs to run on a schedule and is capable of being triggered by a , using this feature can be a real time saver.

One of the reasons I didn’t start using this nice little feature sooner is because I had no idea how to set it up through SSH. When I got the new with installed on it, setup became very easy. I Just used the “Scheduled Task” feature and it was all done.

Well, that’s all fine and dandy for the capable applications on the running , but what about the other servers not running ? I would still have to setup the cronjobs using . Believe it or not, I have been avoiding setting up those jobs to this day. Just a bit of background…these jobs only need to run every few days or so. What I am about to suggest is not really suitable for jobs that need to run every few minutes.

Last night, I started fooling around with “Windows Scheduler.” The link I just gave you is for …the information I am going to give you below is for . I am sure you will get the gist. Scheduler is a great feature similar to that is installed on your own , not the where your website is being hosted, but does something very similar. It automates those boring that you and I would forget about very easily.

So, how do you run a cronjob with Scheduler? If your enabled has a file that needs to be visited (usually something like .php, or something along those lines), it’s quite simple. All you need to do is tell your personal to wake up, open a and visit that page. Here is how you do it:

The first thing you want to do is to open your and click on “System and Maintenance.”

control-panel.gif

Then, on the next page, click “Scheduled .”

scheduled-tasks.gif

After you click that, you will be brought to the Task Scheduler screen. It’s a new window. I am going to go over how I set up a new task this morning. As I said above, all I wanted to do was to have a window open and automatically have it visit a particular .

The first thing I did was to click on the “Task Scheduler Library” and then on “Create Basic Task.” The Task Scheduler Library is where I am going to store these .

task-scheduler.gif

After you click “Create Basic Task,” a window will open with space for you to describe your new task.

create-task.gif

Fill in the information so it’s recognizable to you. Then, click next (down at the bottom). The next window is going to ask you when you want your task to run.

when.gif

I set it to “Daily.” On the next screen, you can adjust it.

On this screen, you can describe more about your daily task, such as start date, time and frequency. I set mine to every other day (a 2 in the recur every: box).

describe-daily.gif

This screen asks you what action you want to perform. As I said above, I wanted to open a , so I click the “Start a Program” button.

action.gif

Here’s is the trickiest part. On the next screen, you have to choose which program and what additional arguments.

start-program.gif

In the “Program/script” box, I browsed to open Firefox, which in this case gave me this path, “C:\Program Files\Mozilla Firefox\firefox.exe.” In the “Add Arguments” box, I put the of my file, such as “http://www.mywebsite.com/.php.”

In the final screen, you are offered a summary of what you filled in. I like the check off the “Open properties” box for some extra steps I needed to take. Click “Finish.”

final.gif

The last few items are quite simple, so I won’t offer screen shots for them. When the Properties box opens up, click the “Conditions” tab up top. Since my goes into sleep mode after a half hour of non use, I want to wake it up to preform the task, so I click the “Wake ” check box. Then, I click the “Settings” tab up top. In case the task is missed for some reason, I click the “Run task as soon as possible…” check box and the “If the task fails, restart every:” check box. You can put your own values in there.

When you are finished, hit “OK” and see how it goes. I tried this with a specific time when the was in use and it had no problems. I haven’t tried it when the was in sleep mode, so we’ll see what happens. Give it a shot and let me know your results.

Related posts