Community discussions

MikroTik App
 
SergeS
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 67
Joined: Fri Mar 25, 2016 6:23 am

"/system package get system version" does not work anymore

Sun Aug 27, 2023 2:22 am

I have script running by scheduler every day for years to make configuration backup. Have just find out this script is not working anymore. Seems like it had stopped working after update to 7.11, but not sure for 100%. Looking in the script I have find out command:
:local sysver [/system package get system version];
is not working anymore, return error: "No such item", and that is what preventing my script from running. Other similar commands, for example:
:local sysname [/system identity get name];
is working with no error.
I do not remember much about syntax of mikrotik scripting language, I made this script years ago. Seems like this broken line is assignment to variable "sysver" the version of RouterOS, in my case it should be "7.11".
Image
Question: why does it stop working? And how to fix it?
 
msatter
Forum Guru
Forum Guru
Posts: 2912
Joined: Tue Feb 18, 2014 12:56 am
Location: Netherlands / Nīderlande

Re: "/system package get system version" does not work anymore

Sun Aug 27, 2023 4:36 am

Use the power of the TAB.......
:local sysver [/system package get routeros version];
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12014
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: "/system package get system version" does not work anymore

Sun Aug 27, 2023 7:59 pm

Seems like it had stopped working after update to 7.11, but not sure for 100%.
This is the classic problem of copying and pasting or not knowing at all what the scripts you use do...
Since version 7.0alpha0 "system" no longer exists, but only "routeros" (which incorporates system, dhcp, ppp, etc.)
 
SergeS
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 67
Joined: Fri Mar 25, 2016 6:23 am

Re: "/system package get system version" does not work anymore

Sun Aug 27, 2023 8:13 pm

Use the power of the TAB.......
:local sysver [/system package get routeros version];
Thank you very much, even twice! I forgot about power of the TAB or did not know ai all. :-)
Have fixed, all works now.

Only one minor cosmetic problem left - I see date reported now as "2023-08-27", although before it was as "Aug-27-2023".
I have parsed it in the script to combine filename using pick, so positions are not a problem, but I would prefer to have "Aug" instead of "08".

Is there any way on how to change date format reported by "/system clock get date" in script, without changing the regional settings and without extra conversion "08" -> "Aug", like using arrays?
Last edited by SergeS on Sun Aug 27, 2023 8:26 pm, edited 1 time in total.
 
SergeS
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 67
Joined: Fri Mar 25, 2016 6:23 am

Re: "/system package get system version" does not work anymore

Sun Aug 27, 2023 8:21 pm

This is the classic problem of copying and pasting or not knowing at all what the scripts you use do...
Since version 7.0alpha0 "system" no longer exists, but only "routeros" (which incorporates system, dhcp, ppp, etc.)
Yep, thank you for comments.
I wrote this script more than 10 years ago, I believe :-). I believe, for Router OS version 3.something. And yes, of course, I have used a lot of copying-and-pasting, but with significant changes by myself, and on that moment, when I wrote it, I definitely knew what script does.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 12014
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: "/system package get system version" does not work anymore

Mon Aug 28, 2023 10:17 am

Is there any way on how to change date format reported by "/system clock get date" in script, […]
No.

Use my scripts as example on how to parse date on both format on same script.
viewtopic.php?t=177551

More specifically
viewtopic.php?p=960070#p960070

Who is online

Users browsing this forum: No registered users and 3 guests