Follow

How do I run a script that could take longer than 2 hours?

KB#:  KKB000421

QUESTION

Kaseya currently has a time limit of 2 hours on scripts because scripts run synchronously on each machine, and a running script will block the execution of subsequent scripts until it finishes. If a script takes longer than 2 hours, Kaseya will force the script to time out.

How do I design a script that initiates an action that could take longer than two hours so that it won't block other scripts from running?

ANSWER

You should end up writing two scripts:

Script A initiates the action (such as defrag.exe)that takes a long timeusing the Execute File command, and either Execute as system and continue immediately, or Execute as user and continue immediately. It then executes script B in 15 minutes time.

Script B checks whether the application (defrag.exe in the example) is still running. If it is, the Then step is used to Execute Script B again in 15 minutes time. If it is not running, then the Else step should be used to complete whatever actions are required after the application has finished.

APPLIES TO

Kaseya K2, G1, IT Center

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

0 Comments

Article is closed for comments.