Run command in specific timeframe

Hello,

I am relativ new to Mikrotik. I want to run a script every minute but only between only between 03:00am and 04:00am.
When I see it correct the scheduler can run commands only in an intervall but not in a timeframe.

Does someone has an idea how a script should look like which I can execute with the scheduler every 2 minutes. I assume there is a way to make this script first check the time and then execute the command when it is between 3 and 4

See if this helps:

:local time [/system clock get time];
:if ($time >= "03:00:00" || $time <= "04:00:00") do={ :log warning hammer time }

Hi,

do you think that I have to post here my own schript?

do={ :log warning hammer time } → for exampe do={ script }

Execute your command inside the do={ }

I tried the following

put the following into a script

:local time [/system clock get time];
:if ($time >= “18:00:00” || $time <= “18:45:00”) do={ ip ipsec active-peers kill-connections }

But it looks luike that the time frame is regocnizes and the command runs every time

Just double checked and it seems RouterOS does not support this type of time calculation without extra math involved.