Reset Config Run after Reset not working right

I have been having this issue lately with 6.4x and higher ROS versions. If I run the following command

/system reset-configuration no-defaults=yes run-after-reset=router.rsc

the system will reboot but it will not load the configuration from the router.rsc file.

If I then logon to the router via MAC-Winbox and then open the terminal and run

import file=router.rsc

the router will successfully load the configuration from the router.rsc file without error.

How do I fix this?

Slight correction. Most of the time it will either not load the configuration from the router.rsc file, or it will only load part of it. I cannot get it to load the whole configuration using the Run After Reset command. It will only load the whole configuration if I reset and then run the import command on the same file using the Terminal.

read this topic

http://forum.mikrotik.com/t/reset-configuration-with-run-after-reset-not-working/110515/1

add 15 seconds delay at the begining of the script.

:delay 15s

That worked, but I do not find that an acceptable solution. I have the router setup to export the router configuration weekly to a router.rsc file. If the customer messes things up I now have to copy the backup file off the router to my computer and then edit it to include the :delay 15s.

If this is a known issue why does mikrotik not either add a built in delay or give us a setting that allows us to choose a delay time before executing the run-on-reset file?

Hopefully MikroTik will put this delay into RouterOS itself sometime… it is really inconvenient that it works this way.
(and I also keep hoping that sometime they will implement a continue-after-minor-error too)

that is the explanation from mikrotik…

“Startup delay”
If your configuration relies on interfaces that might not yet have started up upon command execution, it is suggested to introduce delays, or to monitor until all needed interfaces are available. This example script allows you to set how many interfaces you are expecting, and how long to wait until they become available:

https://wiki.mikrotik.com/wiki/Manual:Configuration_Management

so, how it will be the correct script?

Thanks

Put a :delay at the top and hope for the best!
:delay 30s should be sufficient, if not, increase and repeat.

Can you type me exactly how you mean still i got issues. im doing like this:

:delay 15s
/system reset-configuration no-defaults=yes run-after-reset=xxx


Thanks

No you should put the delay at the top of the script you are going to run after reset.

Done :slight_smile:

Thanks