Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We have a number of Windows Scheduled tasks that run on one Server 2008 Webserver (not R2) which is in a cluster.

We recently moved from an original webserver Cluster to a new webserver Cluser (Server 2008 - not R2).

The new webserver (in the cluster) running the Windows Tasks is setup the same as on the original we believe.

BUT we now find that on the new Windows Server the Windows Task Scheduler seems to want to instantly start each task three times.

If we set the option to queue up a new task we get:

Event ID 324 Task Scheduler queued instance "{9a1a8411-b042-45ff-8e6b-89874df230d7}" of task "\Client Reporting" and will launch it as soon as instance "{2bcc3df6-ea3b-4453-90c2-75b8b1946388}" completes.

If we set the option to stop an existing task we get:

Event ID 323 Task Scheduler stopped instance "{e685a910-b32b-414e-85fd-96bbe54314a2}" of task "\Client Reporting" in order to launch new instance "{4db66265-1f51-4ede-8535-ac7c3cb5c4c1}" .

Ticked settings:

  • Allow task to be run on demand.

  • Run task as soon as possible after a scheduled start is missed.

  • Stop the task if running for longer than 1 hour.

  • If the running task does not end when requested force it to stop.

  • Start the task only if the computer is on AC power.

  • Stop the task if the computer switches to battery power.

Selected option: If the task is already running - stop the existing instance.

Note: We moved the tasks from one server to another in the cluster to see if it the Task Scheduler on the particular server we'd picked causing the problem. Same behaviour.

Could it be something to do with the build of the new servers?

We have very similar tasks set up on another server cluster that work OK without all this multiple starting. Comparing those tasks to the ones here - there does not seem to be anything obviously different in terms of settings available to us through the options within the Task Scheduler.

Trigger: The task is scheduled to be triggered daily, once an hour - and to be stopped if it exceeds this time.

Action: Runs a .bat file.

What could be causing this/where we can look to see what logic is causing the tasks to start multiple times in this way?

share|improve this question
    
What is set to trigger the task? –  Bart Silverstrim May 30 '12 at 12:36

2 Answers 2

We managed to stop Windows Task Scheduler starting up multiple processes by ticking the option "If the task fails, restart every:" with the defaults of "1 minute" and "Attempt to restart up to: 3 times".

This seemed counter-intuitive as

  1. the tasks did not appear to be failing (the actions they perform got run multiple times)

and 2. the tasks already seemed to be deciding to start three times anyway.

Also - we have these same tasks setup on Test webservers and have not needed to tick this option.

share|improve this answer

For whatever reason I can't add a comment to your answer, however it is likely "failing" because the task is returning a exit code other than 0. You can fix this by scheduling a script to run instead of the actual task process. You would have the script run the actual task process, and after it completed check the exit code of the process against a list of known success codes. If it is a success, have the script exit with code 0 and if it was not a success, pass the failure exit code. This way you still retain the ability of task scheduler to rerun the task in case is actually fails.

Unfortunately it is not uncommon for processes which successfully executed to return exit codes other than 0. You would need to check the documentation (or ask the developer) about what the various exit codes are.

share|improve this answer
    
50 rep is needed to comment on others' questions and answers... –  EEAA Oct 13 '13 at 3:05
    
Thanks EEAA. And to follow up on my post it seems Pual is all ready runing a batch script. Without knowing what is in his script, and what exit code it is returning it is hard to say why it is returning a code other than 0, but my comment/answer should still be correct, the Task Scheduler is assuming it will return exit code 0 when it isnt. –  matt burnett Oct 13 '13 at 3:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.