Community discussions

MikroTik App
 
unlikely
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 57
Joined: Fri Feb 21, 2020 1:16 pm

Yet Another Question About Saving Large Strings To A File

Wed Nov 15, 2023 7:51 pm

From what I understand there are some limits on how big a string can be, so we can't simply interpolate/concatenate strings if strings become big.

I read many discussions on this topic with apparently no solution in general case.

So, to be more specific, I would like to save undo and or redo properties of some /system/histroy/print details, in a terminal-compatible way.

The closest approximation I found is something like this:
:local history [/system/history/print detail as-value]
:local historylength [:len $history]

:if ($historylength > 0) do={
    :for i from=($historylength-1) to=0 step=-1 do={ /system/history/print append file="usb/backup/redolist.txt" detail proplist=redo where .id=([:pick $history $i]->".id") }    
}
But this doesn't make a ready to use script. For example:
# 2023-11-13 22:00:00 by RouterOS 7.12
# software id = G8
#
Flags: U - undoable, R - redoable, F - floating-undo 
 F 
    redo=
      /ip service set www address=192.168.220.0/24,192.168.220.0/24 disabled=\
          no port=80 vrf=main
Any way to do?

Who is online

Users browsing this forum: No registered users and 13 guests