I did not check this, so I will ask, is
next-run in the past if scheduler is not triggered while device is off?
If yes, you can just check if
next-run is the past from current date and run schedulers from other startup scheduler that checks
next-run date on them. You can search forum how to create timestamp from string date and time to comare them.
If not and
next-run is always in the future because it is calculated on ROS startup, then is not that simple, device can be off for unknow time, how can you know when scheduler is last triggered with scheduler
start-date +
start-time +
interval? Start date can be some date in past when scheduler is created, it is not updated on each scheduler run so it cannot be used for comparing with
next-run, example of some mine scheduler:
.id=*4;disabled=false;interval=1d00:00:00;name=<some_name>;next-run=2024-02-11 04:00:00;on-event=<script>;owner=admin;policy=ftp;reboot;read;write;policy;test;password;sniff;sensitive;romon;run-count=3;start-date=2022-03-13;start-time=04:00:00
In this case, you save current date and time timestamp to scheduler comment form its script when it runs and create startup scheduler that checks that timestamp if is in the past for each scheduler that needs to be run on startup if not triggered while device was off. You can also update
start-date to current date on each scheduler run and then check
start-date +
start-time +
interval (
start-date and
start-time can be concatenated to single string format and convert to timestamp, for
interval you will need to find function to convert it to seconds) if is in the past with same logic described for last run timestamp in comment, see what is simpler for you to create.