[Feature Request]: 'run-after-reboot'

Good feature: add run-after-reboot option in /system/reboot

  • Syntax:
/system/reboot run-after-reboot={<command>};



  • Sometimes you may need to execute a one time command after this reboot.


  • For certain situations, quick command execution is essential.
    This can be crucial for tasks like disk management configuration, where you need to run commands faster than typical startup processes.

Please don’t be negative. If you like this topic/post, leave a comment u[/u].

Except for “run this only after next restart”, wouldn’t scheduler entry with “start-time=startup” and without setting “interval” do the trick?

The problem with running commands “as quickly as possible” can be that hardware might not be fully initialized at the time that command gets executed and would thus fail. E.g. network might not be up&running yet, so many users do include a “:delay 10” (or something) to the beginning of the script just to make sure router is fully booted before doing anything essential.



  • You are right, and you can add a delay inside curly parentheses, like run-after-reboot={:delay 3s; };


  • I am talking about the case that there is a command that I want to execute only once, without resorting to creating a schedule, nor will I use it again.


  • Please note that I previously requested in a previous post that there be an option to delete the schedule upon its first execution.
    Feature request: adding “remove after next run” feature in schedulers :up_right_arrow:

First and last, having this option never hurts.

What you are suggesting is a relatively minor quality-of-life feature. Functionality wise it is already entirely possible to do.
Scheduler and scripts can also delete themselves when executing so that solves your ‘run once’ problem and it will clean itself up
So you just need to build a small config template, write your desired commands in the middle then paste it into the router

Visual explanation, the unplugger :laughing: :
https://www.youtube.com/watch?v=ApRllnOHxOg

I’m not sure criticality, or need, myself… it’s a “/system/schedule add …” with one extra line in script to “/system/schedule/remove [find name=run-after-reboot]”, as noted.

But the concept does exist with a *FILE named .auto.rsc, see https://help.mikrotik.com/docs/spaces/ROS/pages/328155/Configuration+Management#ConfigurationManagement-AutoImport (old wiki has more details here: https://wiki.mikrotik.com/Manual:Configuration_Management#Automatic_Import )

I didn’t test the auto.rsc file since V6…and it is specific on how the file gets upload (i.e. SFTP)… but YMMV.

Seriously, I could really make use of that.

+1 for the OP.

Schedulers also have enable/disable feature. Startup scheduler can be created where last command disables itself, when needed to run once on boot, edit command(s) above last command, enable scheduler and reboot.