It is stored in /system/script.
And when I invoke it, I have a problem = data variable is empty. I’ve read that variable size is limited by 4KB. However, in one post on this forum I also read, that it was (at some moment in time) send more data (64KB or something like that) and in example I saw a parameter
http-content-type="application/json"
. But I cannot find this parameter in current routeros (7.11). This parameter is also present in documentation on mikrotik documentation website, but only in examples, not in parameters list.
Is there any way to POST an HTTP request, which contains a backup file contents (which is more than 4KB)?
Sending information to a remote host
It is possible to use an HTTP POST request to send information to a remote server, that is prepared to accept it. In the following example, we send geographic coordinates to a PHP page:
But I think doc example is WRONG. There is NO “http-content-type=” as an option to /tool/fetch – at least in 7.12beta (or before AFAIK). So try the http-header-field= method since I know that works.
I suppose that's the way I'll have to do it. Uploading vua FTP and then processing with some scripts or something. I wanted to push backup via HTTP mainly to keep most of functionality in one server-side app.
PS: why change content type???
The export is not json....
Well, no real reason here. Just thought that maybe this http-content-type parameter can somehow affect variable size or something.
Mikrotik documentation is somewhat lacking and sometimes there are undocumented functions and behaviour.
They did fix the docs. The 4K upload limit has not changed.
I’ve used email to get files off RouterOS for a long while, and use a dedicated “RouterOS mailbox” as both the to and from. It works pretty well since email account becomes the “backup server”, with subject line have the router name/etc, already organized by date/time, etc. And if additional backup is needed IMAP can fetch to desktop etc., or you can use some script/code to connect to “routeros” mailbox to get any needed backups for further processing. Still be same “push” to your datacenter, just via SMTP not HTTP.