From all the scripts in the router repository, you need to select only those scripts that are saved under “owner”, for example “Sertik”, exporting them to one .rsc file
It is clear that you can cycle through the contents of the scripts under the desired owner and save them to a text file, but I want to use the command:
/system script export file=users.rsc
but it only exports all the repository scripts at once… How to solve this?
That’s odd. Assuming your user is a full admin with all policies allowed… my expectation be the :export would include all scripts.
They made changes else where in script policy, so I suspect this is new. But begs the question of how to save the entire config if your admin. I think this is a bug, but did not test. Either just in export; or, if it’s some intentional effort to block cross-user access by Mikrotik, it doesn’t offer security since you report you loop to get the other user’s scripts (which be goal in not exporting it).
I do not understand you. I repeat the question: as you know, /system script export file=myscript.rsc will save all the repository scripts in myscript.rsc Scripts stored in the router repository have different properties, including the “owner” property (creator). Is it possible to somehow select scripts by this property and save them into one .rsc file, since /system script export does this or does the ROS router not support this?
My goal is not to get another user’s scripts, but to create a script file under a specific “creator” (owner), also created by me. This is convenient because when /import unpacks scripts, they appear in the repository under a specific owner, which can be called anything and the user/admin will understand where these scripts came from. I use this trick to unpack my script libraries, for example under owner “Sertik”.
Now I do this manually and I have to save all the scripts, then delete all the unnecessary ones, then edit the scripts under the given owner, then do /export. And then restore your script configuration. It’s long and inconvenient. I would like to automate this process.
It’s a pity that the Ikrotik developers didn’t think of making filters in /export… You don’t have a ready-made script or some kind of preparation that could assemble a file from individual scripts in the /export format, so that it would be correctly understood and restored by the /import command ?
False, already are implemented the export of specific scripts…
/system script export where owner=admin
or
/system script export where name=
The problem is to import it for specific user…
I write this to extract at least all possible commands and parameters on RouterOS: http://forum.mikrotik.com/t/new-command-in-routeros-7/169237/1
Simply compare previous version(s) file(s) to last version to show new command(s) AND new parameter(s) to that command(s)…
[rex@tended] > $cmdtree “/system/script”
[…]
/system/script
[…]
export
(a) compact
(a) file
(a) hide-sensitive
(a) show-sensitive
(a) terse
(a) verbose
(a) where[…]
This is what I needed! But the problem is that this only works in ROS 7, starting with the version you specified and does not work at all in ROS 6, since there is no “where” for /export yet…
/system script export <tab> (in ROS 6):
compact file hide-sensitive terse verbose
As you wrote. Your $cmdtree search function (for ROS 7 only but used /console/inspect) possible command parameters is also wonderful and very useful.
I need a solution that would work universally on all versions of ROS. Can you suggest such a thing?
Surely this can be done, but you need to write a whole large script that would select scripts from the repository according to the creator (owner), process each line of them with escaping the necessary symphols and inserting control symphols (and taking into account all the nuances of this process, it is unlikely to work out without mistakes.), etc…, and then write it all into one “export” script file. But it’s a lot of work… It’s easier for me to assemble the necessary .rsc file manually …