Create Dependency Of Scheduled Task On One Another (Windows Task Schedular)





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ height:90px;width:728px;box-sizing:border-box;
}







0















I want to schedule 4 task on windows task schedular.



The conditions are



1. Task 1 should run every 30 mins;
2. Task 2 should run every 1 hour;
3. Task 3 should run every 2 hours;
4. Task 4 should run every 3 hours;
5. None of the 2 task should run at the same time;
6. If error comes in any task it should run again next time;
7. Also, I don't want to maintain any file regarding it.


Thanks in advance.



Additional Details:

Note: For each day we have millions of records.

So completing of each task varies from 30 mins to around 1 hour.


Task 1: Gets data for 0-7 Days, updates it and then saves back to the sql server.

Similarly task 2,3, and 4 does it for 0-14,0-21 and 0-31 days.


Now the problem is with the server that it is single login, i.e if task 2 logins then task 1 is logged out. I don't have any control on the sql server (3rd party).


So a sample of how the task should run is like this



00:00 Task 1 Starts
00:20 Task 1 Completes
00:30 Task 1 Starts
01:00 Task 2 Waiting to start
01:05 Task 1 Completes
01:05 Task 2 Starts
01:30 Task 1 Waiting to start
01:45 Task 2 Completes
01:45 Task 1 Starts
02:00 Task 3 Waiting to start
02:10 Task 1 Completes
02:10 Task 3 Starts
02:30 Task 1 Waiting to start
03:00 Task 4 Waiting to start (Since task 4 already contains task 1, so the waiting task 1 should call off itself)
03:05 Task 3 Completes
03:05 Task 4 Starts
and so on...









share|improve this question

























  • What OS are you using? For instance, server 2008 and above have a vastly improved task scheduler to 2003, if I know what OS you're running I may be able to be of more help.

    – Alex Berry
    Aug 4 '14 at 13:00











  • I m using server 2008. I just want to know how to put dependency among independent task scheduled.

    – Ulquiorra
    Aug 4 '14 at 15:21











  • I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning:

    – Alex Berry
    Aug 4 '14 at 15:36











  • I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning: schtasks /query /TN MicrosoftWindowsWininetCacheTask Where "/TN" is the task name and the line following is the location of the task. This will tell you if something's running, if you can parse the output in a script and then have the script wait until "status" changes from "Running" to "Ready" then you could go from there.

    – Alex Berry
    Aug 4 '14 at 15:36













  • I know this won't help very much, but this would be oh-so-very-much-easier in bash than batch file. You might want to try a powershell script, but I'm not as competent with it as I am with bash.

    – Alex Berry
    Aug 4 '14 at 15:45


















0















I want to schedule 4 task on windows task schedular.



The conditions are



1. Task 1 should run every 30 mins;
2. Task 2 should run every 1 hour;
3. Task 3 should run every 2 hours;
4. Task 4 should run every 3 hours;
5. None of the 2 task should run at the same time;
6. If error comes in any task it should run again next time;
7. Also, I don't want to maintain any file regarding it.


Thanks in advance.



Additional Details:

Note: For each day we have millions of records.

So completing of each task varies from 30 mins to around 1 hour.


Task 1: Gets data for 0-7 Days, updates it and then saves back to the sql server.

Similarly task 2,3, and 4 does it for 0-14,0-21 and 0-31 days.


Now the problem is with the server that it is single login, i.e if task 2 logins then task 1 is logged out. I don't have any control on the sql server (3rd party).


So a sample of how the task should run is like this



00:00 Task 1 Starts
00:20 Task 1 Completes
00:30 Task 1 Starts
01:00 Task 2 Waiting to start
01:05 Task 1 Completes
01:05 Task 2 Starts
01:30 Task 1 Waiting to start
01:45 Task 2 Completes
01:45 Task 1 Starts
02:00 Task 3 Waiting to start
02:10 Task 1 Completes
02:10 Task 3 Starts
02:30 Task 1 Waiting to start
03:00 Task 4 Waiting to start (Since task 4 already contains task 1, so the waiting task 1 should call off itself)
03:05 Task 3 Completes
03:05 Task 4 Starts
and so on...









share|improve this question

























  • What OS are you using? For instance, server 2008 and above have a vastly improved task scheduler to 2003, if I know what OS you're running I may be able to be of more help.

    – Alex Berry
    Aug 4 '14 at 13:00











  • I m using server 2008. I just want to know how to put dependency among independent task scheduled.

    – Ulquiorra
    Aug 4 '14 at 15:21











  • I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning:

    – Alex Berry
    Aug 4 '14 at 15:36











  • I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning: schtasks /query /TN MicrosoftWindowsWininetCacheTask Where "/TN" is the task name and the line following is the location of the task. This will tell you if something's running, if you can parse the output in a script and then have the script wait until "status" changes from "Running" to "Ready" then you could go from there.

    – Alex Berry
    Aug 4 '14 at 15:36













  • I know this won't help very much, but this would be oh-so-very-much-easier in bash than batch file. You might want to try a powershell script, but I'm not as competent with it as I am with bash.

    – Alex Berry
    Aug 4 '14 at 15:45














0












0








0








I want to schedule 4 task on windows task schedular.



The conditions are



1. Task 1 should run every 30 mins;
2. Task 2 should run every 1 hour;
3. Task 3 should run every 2 hours;
4. Task 4 should run every 3 hours;
5. None of the 2 task should run at the same time;
6. If error comes in any task it should run again next time;
7. Also, I don't want to maintain any file regarding it.


Thanks in advance.



Additional Details:

Note: For each day we have millions of records.

So completing of each task varies from 30 mins to around 1 hour.


Task 1: Gets data for 0-7 Days, updates it and then saves back to the sql server.

Similarly task 2,3, and 4 does it for 0-14,0-21 and 0-31 days.


Now the problem is with the server that it is single login, i.e if task 2 logins then task 1 is logged out. I don't have any control on the sql server (3rd party).


So a sample of how the task should run is like this



00:00 Task 1 Starts
00:20 Task 1 Completes
00:30 Task 1 Starts
01:00 Task 2 Waiting to start
01:05 Task 1 Completes
01:05 Task 2 Starts
01:30 Task 1 Waiting to start
01:45 Task 2 Completes
01:45 Task 1 Starts
02:00 Task 3 Waiting to start
02:10 Task 1 Completes
02:10 Task 3 Starts
02:30 Task 1 Waiting to start
03:00 Task 4 Waiting to start (Since task 4 already contains task 1, so the waiting task 1 should call off itself)
03:05 Task 3 Completes
03:05 Task 4 Starts
and so on...









share|improve this question
















I want to schedule 4 task on windows task schedular.



The conditions are



1. Task 1 should run every 30 mins;
2. Task 2 should run every 1 hour;
3. Task 3 should run every 2 hours;
4. Task 4 should run every 3 hours;
5. None of the 2 task should run at the same time;
6. If error comes in any task it should run again next time;
7. Also, I don't want to maintain any file regarding it.


Thanks in advance.



Additional Details:

Note: For each day we have millions of records.

So completing of each task varies from 30 mins to around 1 hour.


Task 1: Gets data for 0-7 Days, updates it and then saves back to the sql server.

Similarly task 2,3, and 4 does it for 0-14,0-21 and 0-31 days.


Now the problem is with the server that it is single login, i.e if task 2 logins then task 1 is logged out. I don't have any control on the sql server (3rd party).


So a sample of how the task should run is like this



00:00 Task 1 Starts
00:20 Task 1 Completes
00:30 Task 1 Starts
01:00 Task 2 Waiting to start
01:05 Task 1 Completes
01:05 Task 2 Starts
01:30 Task 1 Waiting to start
01:45 Task 2 Completes
01:45 Task 1 Starts
02:00 Task 3 Waiting to start
02:10 Task 1 Completes
02:10 Task 3 Starts
02:30 Task 1 Waiting to start
03:00 Task 4 Waiting to start (Since task 4 already contains task 1, so the waiting task 1 should call off itself)
03:05 Task 3 Completes
03:05 Task 4 Starts
and so on...






scheduled-tasks






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Aug 4 '14 at 10:57







Ulquiorra

















asked Aug 4 '14 at 9:40









UlquiorraUlquiorra

10112




10112













  • What OS are you using? For instance, server 2008 and above have a vastly improved task scheduler to 2003, if I know what OS you're running I may be able to be of more help.

    – Alex Berry
    Aug 4 '14 at 13:00











  • I m using server 2008. I just want to know how to put dependency among independent task scheduled.

    – Ulquiorra
    Aug 4 '14 at 15:21











  • I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning:

    – Alex Berry
    Aug 4 '14 at 15:36











  • I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning: schtasks /query /TN MicrosoftWindowsWininetCacheTask Where "/TN" is the task name and the line following is the location of the task. This will tell you if something's running, if you can parse the output in a script and then have the script wait until "status" changes from "Running" to "Ready" then you could go from there.

    – Alex Berry
    Aug 4 '14 at 15:36













  • I know this won't help very much, but this would be oh-so-very-much-easier in bash than batch file. You might want to try a powershell script, but I'm not as competent with it as I am with bash.

    – Alex Berry
    Aug 4 '14 at 15:45



















  • What OS are you using? For instance, server 2008 and above have a vastly improved task scheduler to 2003, if I know what OS you're running I may be able to be of more help.

    – Alex Berry
    Aug 4 '14 at 13:00











  • I m using server 2008. I just want to know how to put dependency among independent task scheduled.

    – Ulquiorra
    Aug 4 '14 at 15:21











  • I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning:

    – Alex Berry
    Aug 4 '14 at 15:36











  • I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning: schtasks /query /TN MicrosoftWindowsWininetCacheTask Where "/TN" is the task name and the line following is the location of the task. This will tell you if something's running, if you can parse the output in a script and then have the script wait until "status" changes from "Running" to "Ready" then you could go from there.

    – Alex Berry
    Aug 4 '14 at 15:36













  • I know this won't help very much, but this would be oh-so-very-much-easier in bash than batch file. You might want to try a powershell script, but I'm not as competent with it as I am with bash.

    – Alex Berry
    Aug 4 '14 at 15:45

















What OS are you using? For instance, server 2008 and above have a vastly improved task scheduler to 2003, if I know what OS you're running I may be able to be of more help.

– Alex Berry
Aug 4 '14 at 13:00





What OS are you using? For instance, server 2008 and above have a vastly improved task scheduler to 2003, if I know what OS you're running I may be able to be of more help.

– Alex Berry
Aug 4 '14 at 13:00













I m using server 2008. I just want to know how to put dependency among independent task scheduled.

– Ulquiorra
Aug 4 '14 at 15:21





I m using server 2008. I just want to know how to put dependency among independent task scheduled.

– Ulquiorra
Aug 4 '14 at 15:21













I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning:

– Alex Berry
Aug 4 '14 at 15:36





I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning:

– Alex Berry
Aug 4 '14 at 15:36













I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning: schtasks /query /TN MicrosoftWindowsWininetCacheTask Where "/TN" is the task name and the line following is the location of the task. This will tell you if something's running, if you can parse the output in a script and then have the script wait until "status" changes from "Running" to "Ready" then you could go from there.

– Alex Berry
Aug 4 '14 at 15:36







I don't think task schedule can directly have dependencies, but whatever scripts your running could include something along these lines at the beginning: schtasks /query /TN MicrosoftWindowsWininetCacheTask Where "/TN" is the task name and the line following is the location of the task. This will tell you if something's running, if you can parse the output in a script and then have the script wait until "status" changes from "Running" to "Ready" then you could go from there.

– Alex Berry
Aug 4 '14 at 15:36















I know this won't help very much, but this would be oh-so-very-much-easier in bash than batch file. You might want to try a powershell script, but I'm not as competent with it as I am with bash.

– Alex Berry
Aug 4 '14 at 15:45





I know this won't help very much, but this would be oh-so-very-much-easier in bash than batch file. You might want to try a powershell script, but I'm not as competent with it as I am with bash.

– Alex Berry
Aug 4 '14 at 15:45










1 Answer
1






active

oldest

votes


















0














task 1 start time: 00:00



task 2 start time: 00:01 (depending on how long task 1 takes to run).



task 3 start time: 00:02 (depending on how long task 2 takes to run).



task 4 start time: 00:03 (depending on how long task 3 takes to run).



That would take care of the overlap, for step number 6, task scheduler shouldn't abort the next attempt if there's an error by default so you're OK there. With regards to maintaining any files, I can't help unless you're more specific about what this task does, it it just runs a script that doesn't write anywhere then there should be nothing to maintain, if it's writing logs or data you want to keep then you need to build a script to manage that data (probably).



If you want a more thorough answer you will have to provide a lot more information, such as what your tasks do, what OS you're running etc.






share|improve this answer
























  • Thanks... Please check the edited question for more details

    – Ulquiorra
    Aug 4 '14 at 10:58












Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "3"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f792110%2fcreate-dependency-of-scheduled-task-on-one-another-windows-task-schedular%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














task 1 start time: 00:00



task 2 start time: 00:01 (depending on how long task 1 takes to run).



task 3 start time: 00:02 (depending on how long task 2 takes to run).



task 4 start time: 00:03 (depending on how long task 3 takes to run).



That would take care of the overlap, for step number 6, task scheduler shouldn't abort the next attempt if there's an error by default so you're OK there. With regards to maintaining any files, I can't help unless you're more specific about what this task does, it it just runs a script that doesn't write anywhere then there should be nothing to maintain, if it's writing logs or data you want to keep then you need to build a script to manage that data (probably).



If you want a more thorough answer you will have to provide a lot more information, such as what your tasks do, what OS you're running etc.






share|improve this answer
























  • Thanks... Please check the edited question for more details

    – Ulquiorra
    Aug 4 '14 at 10:58
















0














task 1 start time: 00:00



task 2 start time: 00:01 (depending on how long task 1 takes to run).



task 3 start time: 00:02 (depending on how long task 2 takes to run).



task 4 start time: 00:03 (depending on how long task 3 takes to run).



That would take care of the overlap, for step number 6, task scheduler shouldn't abort the next attempt if there's an error by default so you're OK there. With regards to maintaining any files, I can't help unless you're more specific about what this task does, it it just runs a script that doesn't write anywhere then there should be nothing to maintain, if it's writing logs or data you want to keep then you need to build a script to manage that data (probably).



If you want a more thorough answer you will have to provide a lot more information, such as what your tasks do, what OS you're running etc.






share|improve this answer
























  • Thanks... Please check the edited question for more details

    – Ulquiorra
    Aug 4 '14 at 10:58














0












0








0







task 1 start time: 00:00



task 2 start time: 00:01 (depending on how long task 1 takes to run).



task 3 start time: 00:02 (depending on how long task 2 takes to run).



task 4 start time: 00:03 (depending on how long task 3 takes to run).



That would take care of the overlap, for step number 6, task scheduler shouldn't abort the next attempt if there's an error by default so you're OK there. With regards to maintaining any files, I can't help unless you're more specific about what this task does, it it just runs a script that doesn't write anywhere then there should be nothing to maintain, if it's writing logs or data you want to keep then you need to build a script to manage that data (probably).



If you want a more thorough answer you will have to provide a lot more information, such as what your tasks do, what OS you're running etc.






share|improve this answer













task 1 start time: 00:00



task 2 start time: 00:01 (depending on how long task 1 takes to run).



task 3 start time: 00:02 (depending on how long task 2 takes to run).



task 4 start time: 00:03 (depending on how long task 3 takes to run).



That would take care of the overlap, for step number 6, task scheduler shouldn't abort the next attempt if there's an error by default so you're OK there. With regards to maintaining any files, I can't help unless you're more specific about what this task does, it it just runs a script that doesn't write anywhere then there should be nothing to maintain, if it's writing logs or data you want to keep then you need to build a script to manage that data (probably).



If you want a more thorough answer you will have to provide a lot more information, such as what your tasks do, what OS you're running etc.







share|improve this answer












share|improve this answer



share|improve this answer










answered Aug 4 '14 at 9:46









Alex BerryAlex Berry

47728




47728













  • Thanks... Please check the edited question for more details

    – Ulquiorra
    Aug 4 '14 at 10:58



















  • Thanks... Please check the edited question for more details

    – Ulquiorra
    Aug 4 '14 at 10:58

















Thanks... Please check the edited question for more details

– Ulquiorra
Aug 4 '14 at 10:58





Thanks... Please check the edited question for more details

– Ulquiorra
Aug 4 '14 at 10:58


















draft saved

draft discarded




















































Thanks for contributing an answer to Super User!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fsuperuser.com%2fquestions%2f792110%2fcreate-dependency-of-scheduled-task-on-one-another-windows-task-schedular%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Plaza Victoria

Brian Clough

Cáceres