Community discussions

MikroTik App
 
heydude
newbie
Topic Author
Posts: 26
Joined: Wed Dec 02, 2015 4:53 pm
Location: CH

scripting file-size limitation 4k

Fri Feb 17, 2017 9:55 am

Hi Folks

I am running into the scripting file-size limitation of 4096bytes problem.
On a CCR1036 with far enough power, I have several text-files with each one line of data. These are status files of remote stations. For monitoring reasons, I have a script, that consolidates all these files into one .txt file.
Until now, this was working fine because there were less than 30 files to combine. Since there are more, the script only consolidates 31 files and comes up with the message "failure: new contents too long".

The command to combine the files is the fallowing:
:local file "path/status.txt"
:file set $file contents=""
:foreach i in=[/file find name~"path/" name!="path/status.txt"] do={/file set \
	$file contents=([/file get $file contents] . [/file get $i \
	value-name=creation-time ] . ";" . [/file get $i \
	contents] . "\r\n")}
I tried to run this directly from system scheduler, import it as .rsc file, run the command in a ssh session...
Always the same result.

Is there any working way to get around this limitation? I really want to do this consolidating on the CCR, not on a external server!

Thanks in Advance for help
 
User avatar
mrz
MikroTik Support
MikroTik Support
Posts: 6045
Joined: Wed Feb 07, 2007 12:45 pm
Location: Latvia
Contact:

Re: scripting file-size limitation 4k

Fri Feb 17, 2017 11:47 am

Who is online

Users browsing this forum: No registered users and 13 guests