I would like to name automatically my export file in the following format:
hEX_S-RB760iGS_6.48.1_20210206-193801
where:
hEX_S-RB760iGS - Hostname
_6.48.1 - Current Firmware
_20210206 - Current Date YYYYMMDD
-193801 - Current time HHMMSS
I have tried the following, but no luck:
export file="\$(HOSTNAME)_\$(FIRMWARE)_\$(DATE)-\$(TIME)"
Does anyone know how to achieve this for "export file" command?
You could do something like
[admin@Mikrotik] > {/system; :put "$[identity get name]_$[routerboard get current-firmware ]_$[clock get date]-$[clock get time]"; / }
Mikrotik_7.1beta4_feb/08/2021-14:06:13
Or use
/system resource get version
instead of the installed firmware. You might also prefer
/system routerboard get serial-number
.
I used a curly brackets block to allow to "chdir" to /system, and save some typing, and then at the end "chdir" back to "/". If you know bash, you'll see that routeros uses
where bash uses
, and
where bash uses