Community discussions

MikroTik App
 
User avatar
leostereo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Thu Oct 18, 2012 11:36 pm
Location: mendoza , argentina
Contact:

Force router to reboot in 5 or 10 minutes from now

Mon Oct 05, 2020 6:15 pm

Hi guys , is there same way to set a script to force router to reboot withing 5 or 10 minutes ?
Something like cisco does:
reload in 10 - restart the router in 10 minutes
Then , to cancel if needed:
reload cance
l

Ok , any idea would be wellcome.
Leandro.
 
Sob
Forum Guru
Forum Guru
Posts: 9188
Joined: Mon Apr 20, 2009 9:11 pm

Re: Force router to reboot in 5 or 10 minutes from now  [SOLVED]

Mon Oct 05, 2020 7:05 pm

You can put "/system reboot" in scheduler and select start time ten minutes in future.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: Force router to reboot in 5 or 10 minutes from now

Mon Oct 05, 2020 7:28 pm

First, you need to understand that this solution will not work for the same scenario as it is often used in Cisco equipment!
In Cisco, any config you have not explicitly saved will be lost when you reboot and the router comes back in the state that was last saved.
However, in MikroTik this is not the case! Everything you configure is immediately committed to flash memory, and a reboot will bring back the same config you last made.
So when you want to do this to guard against config mistakes that lock you out, it will not work.
However, MikroTik has another feature for that: safe mode. When you enable safe mode and then make config changes, and you lose your connection, all changes are rolled back to the moment you enabled safe mode. When you end safe mode yourself, all changes are committed and will remain in place.

So please study that before trying your reboot-in-5-minutes solution which will not work as you expect.
Other than that, I usually have a job in the system scheduler to to a reboot once at some specified time, and e.g. when I want to update RouterOS I only download it and then set the time for the reboot the next night e.g. at 01:00 or 03:00 and it will reboot and install the update at that time. That works fine.
 
User avatar
leostereo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Thu Oct 18, 2012 11:36 pm
Location: mendoza , argentina
Contact:

Re: Force router to reboot in 5 or 10 minutes from now

Tue Oct 06, 2020 2:30 pm

First, you need to understand that this solution will not work for the same scenario as it is often used in Cisco equipment!
In Cisco, any config you have not explicitly saved will be lost when you reboot and the router comes back in the state that was last saved.
However, in MikroTik this is not the case! Everything you configure is immediately committed to flash memory, and a reboot will bring back the same config you last made.
So when you want to do this to guard against config mistakes that lock you out, it will not work.
However, MikroTik has another feature for that: safe mode. When you enable safe mode and then make config changes, and you lose your connection, all changes are rolled back to the moment you enabled safe mode. When you end safe mode yourself, all changes are committed and will remain in place.

So please study that before trying your reboot-in-5-minutes solution which will not work as you expect.
Other than that, I usually have a job in the system scheduler to to a reboot once at some specified time, and e.g. when I want to update RouterOS I only download it and then set the time for the reboot the next night e.g. at 01:00 or 03:00 and it will reboot and install the update at that time. That works fine.
1 _ Im aware about your points.
Im working on following situation.
After do some changes on existing bonding interface , interface goes down and I loss acces to router.
Only router reboot takes the interface back again.
Unfortunately I can not be physically on site for this.
And ... "safe mode" does not work for me in this case ... It already makes me rush to site at 4am.
So ... only thing I need is a waranted operation to make the router reboot.
I will try with scheduller , just want to make sure it was something better for this.
Thanks.
 
pe1chl
Forum Guru
Forum Guru
Posts: 10529
Joined: Mon Jun 08, 2015 12:09 pm

Re: Force router to reboot in 5 or 10 minutes from now

Tue Oct 06, 2020 5:44 pm

The scheduler is the advised way to do that. Just enter a one-time (00:00:00 repetition interval) job and set the correct time for it to run.
I have a job like this in the scheduler at all times:
/system scheduler
add name=scheduled_reboot on-event="/system reboot" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=jul/30/2020 start-time=01:01:01
When I need to schedule a reboot I just set the time and date and it runs.
 
User avatar
leostereo
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 92
Joined: Thu Oct 18, 2012 11:36 pm
Location: mendoza , argentina
Contact:

Re: Force router to reboot in 5 or 10 minutes from now

Tue Oct 06, 2020 7:09 pm

The scheduler is the advised way to do that. Just enter a one-time (00:00:00 repetition interval) job and set the correct time for it to run.
I have a job like this in the scheduler at all times:
/system scheduler
add name=scheduled_reboot on-event="/system reboot" policy=\
    ftp,reboot,read,write,policy,test,password,sniff,sensitive,romon \
    start-date=jul/30/2020 start-time=01:01:01
When I need to schedule a reboot I just set the time and date and it runs.
Thanks !! did not know abput the 00:00:00 interval.
 
User avatar
bpwl
Forum Guru
Forum Guru
Posts: 3127
Joined: Mon Apr 08, 2019 1:16 am

Re: Force router to reboot in 5 or 10 minutes from now

Tue Oct 06, 2020 9:21 pm

interface goes down and I loss acces to router.
Only router reboot takes the interface back again
Maybe "Tools/Netwatch" or "System/Watchdog" can help you out.

Who is online

Users browsing this forum: No registered users and 23 guests