Kaseya Community

2 Hour timeout

  • When we bring on new clients one of the steps is to schedule a defrag of the workstation drives. Some of these workstations have never been defraged and the process takes longer then the 2 hour time period allowed for scripts. When this happens I get a script failed alert.

    Does anyone know a way to get around the 2 hour limit?

    Legacy Forum Name: 2 Hour timeout,
    Legacy Posted By Username: akoop
  • Usually the way to do this is to split the script into "execute" and "check" portions. Make one script that starts the defrag process and then ends, that's all it does. Then have another script to see if the defrag needed to happen, and if it' s proceeding. If the defrag is proceeding, schedule a "check status" script to execute 15 minutes in the future. When that script runs, it checks if the defrag is still running. If it is, it schedules itself for 15 minutes in the future again. This can happen over and over again until the defrag completes.

    Now be careful with a method like this, you could get stuck in a loop if you don't setup your exit conditions properly. But if done correctly, this will allow you to bypass the time limit, as your scripts are just running for a few seconds, and then scheduling status checks every 15 minutes until it's done.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: arobar
  • We just have the script execute jkdefrrag and exit. Weather a defrag is required or not is really irrelevant.

    If it is....it runs and fixes it.

    if its not....it runs an finishes quickly.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: XeviouS
  • There is a database field that controls the length of timeout. Place a ticket with support and they can make the adjustments. We had ours changed to 4 hours.

    Legacy Forum Name: Scripts Forum,
    Legacy Posted By Username: doug.jenkins@ispire.ca