Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Task Scheduler - Run only during window of time

I have a task already set up in the Windows Scheduler (on Win Server 2008). It works great but it can put a burden on the system during peak hours (when the box is being used for other things). I currently run the job every 15 minutes. Can Task Sch. be setup to run every 15 minutes but only during a certain window of time. So I could set it up to run every 15 min, but only from 5pm to 5am -- and not run at all from 5am to 5pm?

like image 228
Bryan Lewis Avatar asked Dec 08 '10 17:12

Bryan Lewis


People also ask

What is for a duration of in Task Scheduler?

Duration is probably the number of days after the start and first run date that you want this task to repeat. "Repeat task every: This setting allows you to set a repetition time interval for the task. The task will run, wait for the time interval specified, and then run again.

How do I change the time on my Task Scheduler?

When you have found it, Right Click on it and choose Properties. In the Properties window click on the Triggers tab and then click the Edit button at the bottom of the edit task window. You should be able to change the time from there.

Does Task Scheduler have to be open to run?

Regardless of the Windows version or edition you have, you can also use the Run window to launch the Task Scheduler. Press the Windows + R keys on your keyboard to open Run, and then type taskschd.


2 Answers

Set a daily schedule starting at 5pm. In the Advanced dialog, click Repeat task, then specify Every=15 minutes, Until:Time=5am.

Edit: The above instructions are for Windows 2003 Server or XP. If Windows Server 2008 is like Windows 7, then you can do the same thing through the Triggers tab. Set a daily trigger, Start=5pm, Repeat Task Every=15 minutes, For a duration of=12 hours. You don't need to stick with the pre-defined times - you can type into these fields any value you wish.

like image 169
Tim Robinson Avatar answered Sep 18 '22 12:09

Tim Robinson


For Windows 2008 & above this is what I did:

  1. Create task
  2. Triggers tab
  3. New ...
  4. Use the following settings

Schedule

In this particular example I want to run the task from 12:06 AM to 23:50 PM.

In "for a duration of" I entered the amount of minutes I want it to run for. Actually you could also enter some thing like 23:50:00 in the "for a duration of" field. It will automatically convert it to minutes after you click OK. That was my experience.

like image 31
Abhi Avatar answered Sep 18 '22 12:09

Abhi