Kaseya Community

schedule scripts

  • Hey there :) i wish to schedule Kaseya scripts to run from 6am to 8pm during the week. i only find the option to tell it to start it each x hours, x weeks or x months. does anybody have an idea how to do that? thanks for your help
  • when you say you wish to schedule scripts to run from 6 - 8pm - what exactly are you trying to achieve.

    when you schedule you need to specify a time and a window to run?

    Sorry not fully following

  • Oh, i am sorry. I didnt tell everything^^

    I want a script to start each minute from 6am-8pm.

    Only thing i can do is tell Kaseya to start the script each minute but i dont know where to give a time-window.

  • oh ok

    The only way to do that is set it to run from 00:00 to 11.59pm Mon - Fri and at the bottom there is an exclude time range.

    Note though that depending on how busy your server is and how many of these you are running there is no guarantee that this will run every minute as the scripts get scheduled so if 200 scripts fire off every minute you will probably see some lag.

    What are you trying to run every minute - would it not be better to create a scheduled task on the machine obviously depends on purpose...

  • actually just thinking that won't work cause you can only exclude one time range.

    What about run the script and at the end of the script schedule it to run again in a minute - then in the script do a time check on the local machine and if past 8pm skip the schedule script section..

    That way you would schedule the script to run at 6am daily Mon-Fri and thats it then the script would look after running again every minute and also stopping itself....

  • Hey,

    "The only way to do that is set it to run from 00:00 to 11.59pm Mon - Fri and at the bottom there is an exclude time range."

    Where can i do that? If you could tell me that, i could try and see if i get it to work how i want it.

    Then i could try the reschedule thing, but i remember, that this way wasnt so (dont know the perfect word for that) stabil (?).

    The script is starting a batchfile on the local machine and my boss whishes it that way.

    We already have the same script running each minute on 4 other machines without a time-window since months and its doing fine.

    Thank you so much for helping :)

  • When you schedule the script at the bottom of the schedule window there is an option to exclude time ranges. But as I said you can only exclude one range so you could exclude from 00:00 to 6am but not then from 8pm to 00:00

    The issue with running scripts like this is that if your server gets busy running anything else these may not run on time, as I said if your server is not busy at all then you should not have a problem.

    Personally I would try to use windows scheduled tasks means no load on your kserver and you could create a script to create the scheduled task  / delete it / change it.. but thats just me.

  • Curious why you don't have the option to schedule every minute - I do.  You would then tell it what time you want it to start - give it a 1 minute distribution window - to run every minute.  It's a pity the Exclude won't let you choose weekends but we can't have everything (we'd really really like it though Kaseya) So you'll need to save the procedure 5 times as Monday - Friday Procedure name then schedule in on the appropriate days.

    Like Michael I'd be worried about the load you're putting on the Kaseya server depending on how many machines you need to run this on.

  • it's such a shame Kaseya doesn't have two exclude windows or more simply one include window

    MMartin has the right answer though

    What about run the script and at the end of the script schedule it to run again in a minute - then in the script do a time check on the local machine and if past 8pm skip the schedule script section..

    mind you as others have said kaseya scheduling it's accurate to the clock so it will only be aproximately and this kinda thing should only be done on a few machines as server load can be a serious issue 


    I know its german but you should have the same just in english and should be able to look at yours and see what i did.
    I finally found this place to schedule scripts, before i just clicked on the script and scheduled it there.

    This is my schedule window for scripts. Here it gives me the option to say run the script regularly between 9am and 10am each 0.017 hours (each minute).
    What it does now i running the script all day long each minute. just dont understand that :(

    Does anybody know what i do wrong here? If you need any other informations or screenshots, just tell me.

    Thank you all so much for your help and ideas! 
    Oh and no worries, this server is only running 4 of those each minute scripts and its only for a limited time.
    The other each-minute-scripts i talked about before, are running at another Kaseya server since months and everything is fine there :)

  • Oh and i also tried to tell the script to start again after a minute, it doesnt work. It just tells me that it fails at that step. so i guess a script cant start itself again. the first script is starting another sript at the end, so i tried to start script 1 at the end of script 2 but also this doesnt work. just guess, that script 1 maybe is not finished until script 2 is finished, so its the same problem, that script 1 just cant start itself or so. that all doesnt not work with run script immediate and run script after a minute.

    also i dont like the idea that a script starts itself, couldnt i end up in an endless loop??? i´m not a pro at all this how you recognize, so sorry if i´m saying anything wrong.

  • Ok on the second part you are probably using Execute Procedure wait 1 minute - if this is the case that is wrong as the first script can't run itself again while running instead use the Schedule Procedure - then your time delay is 1 min.

    In relation to an endless loop yes you would end up in a loop unless you had a break out and your breakout is the time - so If not 8pm run Script 1 else finish - that way your schedule the script to run at 6am daily and it will run in a loop until 8pm then stop until the next day at 6am.

    As for your first comment you are using the script distribution window this is not designed for what you want.

    Script distribution is used to manage large amounts of scripts - so if I schedule a script to run at 5pm daily on 600 machines then another engineer schedules another script to run at 5.30 on 600 machines we are going to get a serious lag on our server. With the distribution window I can click here and see all the scripts scheduled and then say actually spread these out over this period instead that way it eases the load the Kserver.

    You scheduling options are actually where you are scheduling a machine so click your script pick your machine and then click Schedule.

  • At the scripts i tried Execute Procedure and Schedule Procedure, both didnt work. Does it work for you?

    I know that sounds stupid, but how can i tell the script to prove the time?

    Ok, what you are saying about where to go to schedule my scripts, is where i was before and i have no option there to give it a time range.
    I have Managed Service Edition - G1 :
    I wish i could show a screenshot from my schedule options but somehow it wont let me, sry.

  • Can you export the script and give me the script.

    I am not sure about the G1 version so can't help you there is that the latest version of G1

  • I still have access to a G1 5.1 (didn't realise there was a 5.2) server or two to test things.  Does now make sense why you don't have the menu options I mentioned previously.  

    Not sure if it will work or not but you could use the scheduler to run the script every 0.0167 of a Hour

    [edited by: Alistair Curran at 7:29 AM (GMT -7) on 9-2-2011] hit post too quickly