Community discussions

MikroTik App
 
Sinot
just joined
Topic Author
Posts: 8
Joined: Wed Aug 25, 2021 10:01 am

RouterOS auto-upgrade

Wed Aug 25, 2021 10:58 am

Hello!

I want to update my MikroTik from a remote MikroTik router. I found the instruction and followed its directions.
On the first router (MK1 192.168.6.1), I uploaded the package to the root folder.
On the second router (MK2 192.168.6.2), I added information about the first router to update. System -> Auto Upgrade -> Upgrade Package Sources -> New Package Sources
Address: 192.168.6.1
User: admin
Password: ****

Then I go to System -> Auto Upgrade -> Avaliable Packages and press the "Refresh" button and nothing happens.
In the MK1 logs, we observe the connection for exactly a minute.
09:50:47 user admin logged in from 192.168.6.2 via winbox
09:51:47 user admin logged out from 192.168.6.2 via winbox
There is nothing in the MK2 logs.

I tried putting various packages into different folders of the MK1 file system, including a USB flash drive.

How can I make this system work?

Info:
MK1
model: RBD52G-5HacD2HnD (hAP ac^2 (arm))
routeos-arm: 6.48.4
MK2
model: RBD52G-5HacD2HnD (hAP ac^2 (arm))
routeos-arm: 6.47.9
Packages
routeos-arm-6.48.4.npk
system-6.48.3-arm.npk
Thank you in advance.

P.S. Forgive me my not perfect English.
 
parham
Frequent Visitor
Frequent Visitor
Posts: 62
Joined: Sun Feb 15, 2015 11:35 pm

Re: RouterOS auto-upgrade

Wed Aug 25, 2021 11:13 am

Hey, I have wrote a script that will update it to latest its on the time you specify, happy for anyone to summarise it and use it.

/system script
add dont-require-permissions=no name=auto_upgrade owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":global Date [/system clock get date]\r\
\n:global DateDay [:pick \$Date 4 6]\r\
\n:global DateNextDay {\$DateDay+1} \r\
\n:global DateMonth [:pick \$Date 0 3]\r\
\n:global DateYear [:pick \$Date 7 11] \r\
\n{\r\
\n:if (\$DateDay=25) do={\r\
\n:log info \"Schedule for tonight upgrade\";\r\
\ndelay 1\r\
\n/system scheduler set start-date=\"\$DateMonth/\$DateNextDay/\$DateYear\" start-time=04:00:00 Auto_Upgrade disabled=no;\r\
\n} else={\r\
\n:log info \"No update needed\";\r\
\n}\r\
\n}"
add dont-require-permissions=no name=Firmware_Update owner=admin policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon source=":global Date [/system clock get date]\r\
\n:global DateDay [:pick \$Date 4 6]\r\
\n:global DateNextDay {\$DateDay+1} \r\
\n:global DateMonth [:pick \$Date 0 3]\r\
\n:global DateYear [:pick \$Date 7 11] \r\
\n:if ([/system routerboard get current-firmware] = [/system routerboard get upgrade-firmware]) do={\r\
\n:log info \"No firmware update needed\"\r\
\n/system scheduler set Firmware_Reboot disabled=yes;\r\
\n} else={\r\
\n:log info \"Firmware has been update and reboot needed\"\r\
\n/system scheduler set Firmware_Reboot disabled=yes;\r\
\ndelay 1\r\
\n/system scheduler set start-date=\"\$DateMonth/\$DateDay/\$DateYear\" start-time=04:30:00 Firmware_Reboot disabled=no;\r\
\n}\r\
\n}\r\
\n"

/system scheduler
add name=Auto_Upgrade on-event="/system package update\r\
\nset channel=long-term\r\
\n:delay 2\r\
\ncheck-for-updates once\r\
\n:delay 10\r\
\n/system scheduler set Auto_Upgrade disabled=yes;\r\
\n{\r\
\n:if ( [get status] = \"New version is available\") do={\r\
\n/system scheduler set start-date=\"\$DateMonth/\$DateDay/\$DateYear\" start-time=04:30:00 Firmware_Reboot disabled=no;\r\
\n:delay 1\r\
\n/system package update install;\r\
\n install } else={/system scheduler set Firmware_Reboot disabled=yes;\r\
\n}\r\
\n}" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=mar/13/2021 start-time=04:00:00
add interval=1d name=DailyUpdateCheck on-event=auto_upgrade policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=mar/12/2021 start-time=01:00:00
add disabled=yes name=Firmware_Reboot on-event="/system scheduler set Firmware_Reboot disabled=yes;\r\
\n/system reboot" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon start-date=mar/12/2021 start-time=16:29:00
 
Sinot
just joined
Topic Author
Posts: 8
Joined: Wed Aug 25, 2021 10:01 am

Re: RouterOS auto-upgrade

Wed Aug 25, 2021 11:44 am

Thank you for your message.

But none of my routers have internet access. My goal is to manually update only one MK, and the rest of the MK will be updated from it.

I found an article on how to issue an MikroTik's Amazon servers. This is close to what I want, but too expensive. I don't want to configure DUDE for the same reason. There is a simple way, and people succeed, but not me.
 
Sinot
just joined
Topic Author
Posts: 8
Joined: Wed Aug 25, 2021 10:01 am

Re: RouterOS auto-upgrade

Wed Aug 25, 2021 3:21 pm

I studied the wiki again and noticed that the description of updating the router from the router is in the "Older options" section before version 6.31.
Is this really an outdated update method?
 
User avatar
mkx
Forum Guru
Forum Guru
Posts: 11381
Joined: Thu Mar 03, 2016 10:23 pm

Re: RouterOS auto-upgrade

Wed Aug 25, 2021 3:30 pm

If you want to manually update router, then you have to transfer needed package files (first check the list of installed packages on target router) to device, you can use scp from management machine, possibly you can use ftp (but have to configure router to allow ftp connections). The right target folder depends on particular target router model, mostly it's fine to put files in root of remote storage space. After that reboot router and if all files are fine, it would upgrade on the fly.

Not exactly automatic, but does the trick even if devices don't have internet access.
 
parham
Frequent Visitor
Frequent Visitor
Posts: 62
Joined: Sun Feb 15, 2015 11:35 pm

Re: RouterOS auto-upgrade

Wed Aug 25, 2021 8:44 pm

You can always use Dude and do the update with that.

Who is online

Users browsing this forum: jookraw, lurker888, Wave and 44 guests