Skip to content
DataMiner Dojo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Updates & Insights
  • Questions
  • Learning
    • E-learning Courses
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • YouTube Videos
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Agility
      • Learn more about Agile
        • Agile Webspace
        • Everything Agile
          • The Agile Manifesto
          • Best Practices
          • Retro Recipes
        • Methodologies
          • The Scrum Framework
          • Kanban
          • Extreme Programming
        • Roles
          • The Product Owner
          • The Agile Coach
          • The Quality & UX Coach (QX)
      • Book your Agile Fundamentals training
      • Book your Kanban workshop
    • >> Go to DataMiner Docs
  • DevOps
    • About the DevOps Program
    • Sign up for the DevOps Program
    • DataMiner DevOps Support
    • Feature Suggestions
  • Downloads
  • Swag Shop
  • PARTNERS
    • Business Partners
    • Technology Partners
  • Contact
    • Sales, Training & Certification
    • DataMiner Support
    • Global Feedback Survey
  • >> Go to dataminer.services

Prevent scheduled task script execution when script is still busy

67 views11 hours agoAutomation script Scheduler Task
1
Mieke Dryepondt [SLC] [DevOps Advocate]4.21K 15 hours ago 0 Comments

How can I make sure a scheduled task does not execute a new script run in case a previous one is still busy?

I have a scheduled task that runs every X minutes.
In rare / exceptional cases it is possible that the execution of the script takes longer than this time.
In those cases I rather have the next scheduled task trigger to skip the execution and wait until the running script has finished.
This to prevent an increasing load / queue of scripts running.

I also don't want to decrease the frequency of the scheduled task as in normal situations it would then not update fast enough.
I just have to cover the exceptional case.

José Silva [SLC] [DevOps Enabler] Answered question 11 hours ago

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
0
José Silva [SLC] [DevOps Enabler]2.10K Posted 11 hours ago 0 Comments

Hi Mieke,

I don't know if there is a better way to handle this, but one approach could be to introduce an extra layer between the scheduled task and the actual script.

The scheduled task would still trigger every X minutes, but instead of directly starting the actual script, it would trigger a small wrapper/guard script.

That wrapper script would first check if the actual script is already running. If it is, it simply does nothing and exits. If it isn't, it starts the actual script.

I think it makes sense to have this check in a separate wrapper script rather than in the actual script itself. Once the actual script has started, it is already too late to determine whether another instance should have been started by the scheduler. The wrapper can make that decision before triggering the actual script.

This way, you can keep the current scheduling frequency for normal situations, while preventing multiple instances of the script from running at the same time when an execution takes longer than expected.

Something along the lines of:

Scheduled task → wrapper script → actual script

In order to determine if a particular script is already running, you can follow the approach described here:

Verify if automation script is (still) running - DataMiner Dojo

PS: If you find a way to retrieve the number of active runs of a particular script, then you wouldn't need the wrapper script. You could simply check the number of active runs before starting a new one. If the count is one, you know there is no other instance running.

Kind regards,

José Silva [SLC] [DevOps Enabler] Answered question 11 hours ago
You are viewing 1 out of 2 answers, click here to view all answers.
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas
Privacy Policy • Terms & Conditions • Contact

© 2026 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin