{"id":3674,"date":"2013-07-31T00:05:02","date_gmt":"2013-07-30T22:05:02","guid":{"rendered":"http:\/\/contoso.se\/blog\/?p=3674"},"modified":"2013-07-31T00:05:40","modified_gmt":"2013-07-30T22:05:40","slug":"schedule-runbook","status":"publish","type":"post","link":"http:\/\/contoso.se\/blog\/?p=3674","title":{"rendered":"Schedule runbooks"},"content":{"rendered":"<p>From time to time there are questions around using Orchestrator as a batch robot, for example run a set of file copy jobs every night. In general Orchestrator was not designed as a job scheduler, even it if would work in small scale. Challenges you can run into when trying to this are<\/p>\n<ul>\n<li>There is not a single view to show when you have schedule which runbooks. For example if you want to check all runbooks configured to run every night you have to browse through all your runbooks in Runbook Designer.<\/li>\n<li>There is not a single view to show all the calendars you have configured and how they are configured.<\/li>\n<li>There is not a single view to see if all runbooks was successfully last ran, for example if you have a number of runbooks running every night you want to have one view in the morning to verify that everything worked.<\/li>\n<li>There is no easy way to import a calendar from another tool<\/li>\n<li>By default a runbook server can run 50 jobs at the same time. You can reconfigure this (<a href=\"http:\/\/technet.microsoft.com\/en-us\/library\/hh420378.aspx\">http:\/\/technet.microsoft.com\/en-us\/library\/hh420378.aspx<\/a>) but you should consider the resource requirements of the runbooks on a particular server. Lets say you start one runbook that checks for new files in a folder and then for each new file you invoke another runbook. What if there are 1500 new files in that folder? 1500 running runbooks would require a lot of runbook servers to run all that at the same time. If you don\u00e2\u20ac\u2122t have another runbook servers a queue would be built up, which could result in long delays and affect other runbooks.<\/li>\n<\/ul>\n<p>If you still want to schedule a runbook, for example to run every 12 hours, you can use a Monitor Date\/Time activity. A disadvantage is that the runbook will be running all the time, monitoring the schedule. As the runbook is running all the time, it will use one of the 50 (by default) slots on your runbook server.<\/p>\n<p>If you want to run your runbook 01.00 on Sundays only\u00c2\u00a0you can also use the Monitor Date\/Time activity, but you need to combine it with a runbook level schedule. Create a new schedule, check only Sundays, and configure your runbook to use the new schedule. You configure the runbook to use the schedule by right-click on the runbook tab, select\u00c2\u00a0properties and then click\u00c2\u00a0schedule.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-01.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-3675\" alt=\"20130730-01\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-01-300x106.jpg\" width=\"300\" height=\"106\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-01-300x106.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-01.jpg 721w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>After\u00c2\u00a0you have configured a runbook to run for example every Sunday at 1 am you start it. The runbook\u00c2\u00a0will get the green &#8220;running&#8221; icon and in the database it will be marked as pending. Once it gets Sunday at 1 am the runbook will run. After\u00c2\u00a0the schedule time window the runbook will\u00c2\u00a0stay in running status, until next schedule time window,\u00c2\u00a0even if it is not allowed to execute between the schedule\u00c2\u00a0time windows. \u00c2\u00a0If the runbook tries to run other times a platform event will be generated.<\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-02.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-3676\" alt=\"20130730-02\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-02-300x231.jpg\" width=\"300\" height=\"231\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-02-300x231.jpg 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-02.jpg 436w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-03.JPG.png\"><img decoding=\"async\" loading=\"lazy\" class=\"aligncenter size-medium wp-image-3677\" alt=\"20130730-03.JPG\" src=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-03.JPG-300x278.png\" width=\"300\" height=\"278\" srcset=\"http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-03.JPG-300x278.png 300w, http:\/\/contoso.se\/blog\/wp-content\/uploads\/2013\/07\/20130730-03.JPG.png 399w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Instead of using Orchestrator\u00c2\u00a0to trigger runbooks based on a\u00c2\u00a0schedule you can use Windows Schedule Tasks, <a href=\"http:\/\/blogs.technet.com\/b\/orchestrator\/archive\/2012\/05\/18\/using-windows-task-scheduler-to-invoke-scheduled-runbooks.aspx\">see this blog post<\/a> from the Orchestrator Engineering team. I have two related blog posts around this, one about <a href=\"http:\/\/contoso.se\/blog\/?p=3366\">execute runbook later<\/a>\u00c2\u00a0and one about runbook servers in <a href=\"http:\/\/contoso.se\/blog\/?p=3420\">different time zones<\/a>.<\/p>\n<p>Note that this is provided \u00e2\u20ac\u0153AS-IS\u00e2\u20ac\u009d with no warranties at all. This is not a production ready management pack or solution, just an idea and an example<\/p>\n","protected":false},"excerpt":{"rendered":"<p>From time to time there are questions around using Orchestrator as a batch robot, for example run a set of file copy jobs every night. In general Orchestrator was not designed as a job scheduler, even it if would work in small scale. Challenges you can run into when trying to this are There is &hellip; <a href=\"http:\/\/contoso.se\/blog\/?p=3674\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0},"categories":[60],"tags":[],"_links":{"self":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3674"}],"collection":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3674"}],"version-history":[{"count":2,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3674\/revisions"}],"predecessor-version":[{"id":3679,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=\/wp\/v2\/posts\/3674\/revisions\/3679"}],"wp:attachment":[{"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3674"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/contoso.se\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}