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 you 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

Schedule task for tomorrow

Solved67 views2 days ago#automationScipt #automationscripts Scheduler Task
0
Jan Palansky [DevOps Advocate]210 2 days ago 0 Comments

Hi Dojo,
I'm coping with scheduling task. I've found out, that I'm unable to create a task for tomorrow.

I have simple script:

DateTime timeFrom, timeTo;

var scheduler = new Scheduler(engine.GetUserConnection(), t => t.TaskName.StartsWith("TestSchedule"));

var scheduleOnce = new ScheduleOnce(createSchedulerEvent: false);
var paramsList = new List<AutomationScriptInputParameter>{};

timeFrom = DateTime.Now.AddDays(1).AddMinutes(2);
timeTo = timeFrom.AddMinutes(1);
engine.GenerateInformation($"As defined StartTime: {timeFrom} StopTime: {timeTo}");

var scriptActionStart = new AutomationScriptAction("Test", checkSets: false, runAsync: false, paramsList, Array.Empty<Skyline.DataMiner.Net.Messages.AutomationProtocolInfo>());
var taskStart = new Skyline.DataMiner.Core.Scheduler.Automation.SchedulerTask($"TestSchedule {timeFrom} - {timeTo}", $"Test schedled tast", timeFrom, timeTo, scheduleOnce, scriptActionStart);

engine.GenerateInformation($"In task StartTime: {taskStart.StartDateTime} StopTime: {taskStart.EndDateTime}");

scheduler.CreateOrUpdateSchedulerTask(taskStart);

I expected the schedule to run tomorrow, and the debug output in information events confirms the correct dates.

However, the scheduler task is actually created for today.

can you tell me what I am doing wrong?

Jan Palansky [DevOps Advocate] Selected answer as best 2 days ago

1 Answer

  • Active
  • Voted
  • Newest
  • Oldest
1
Julien Vermeulen [SLC] [DevOps Advocate]191 Posted 2 days ago 1 Comment

Hi Jan,

you will need to set the TaskStartDate on the ScheduleOnce object after creation. I believe only the time of your startTime is taken into account when creating the SchedulerTask object. See following example

var startTime = DateTime.Today.AddDays(1);
var scheduleOnce = new ScheduleOnce();
scheduleOnce.TaskStartDate = startTime;
var taskToBeScheduled = new SchedulerTask("Placeholder", "placeHolder", startTime, DateTime.MaxValue, scheduleOnce);

Kind regards,

Jan Palansky [DevOps Advocate] Posted new comment 2 days ago
Jan Palansky [DevOps Advocate] commented 2 days ago

Thank you very much. Now it works fine.

Could I ask, is this somewhere documented?

You are viewing 1 out of 1 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

© 2025 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