Automate ".backup" files?

General discussion of anything Unimus
thobias
Posts: 19
Joined: Mon Aug 08, 2016 11:19 am

Thu Nov 29, 2018 11:43 am

What about when you have different interfaces or something dynamic matching a fw-rule?
Lets say I need to restore a Hex that uses a USB-LTE-modem, if I do not have the modem plugged in when doing /import it will fail with "input does not match any value of interface" because "LTE1" interface do not exist yet.
User avatar
Tomas
Posts: 628
Joined: Sat Jun 25, 2016 12:33 pm

Thu Nov 29, 2018 12:19 pm

Few possibilities here:
1) if the new device is supposed to have the LTE modem even after restore - simply plug it in before import
2) if the new device is not supposed to have LTE, you can just search the config for "lte1" and remove the lines referencing it
3) if the new device is supposed to have LTE, but you can't plug it in now, you can search for "lte1" lines, and cut them out
after the device is put in place and LTE reconnected, just paste those remaining lines into the CLI

If you want to completely automate option 3, you can put those lines into a file.
Create a scheduled script which will run on next boot that will import that file.
After that the script should delete the file, and delete the schedule.
Of course, connect the LTE modem before the boot.
thobias
Posts: 19
Joined: Mon Aug 08, 2016 11:19 am

Thu Nov 29, 2018 3:57 pm

3 would be the option then, I just need to be more careful when restoring config. Or maybe send a feature request to Mikrotik to be able to "/import config.rsc force=yes" to accept config on things that do not exist yet.
Post Reply