User Tools

Site Tools


networking:router:mikrotik_reboot

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
networking:router:mikrotik_reboot [2016/11/21 11:38]
gcooper created
networking:router:mikrotik_reboot [2018/11/30 11:32] (current)
gcooper
Line 1: Line 1:
 ====== Reboot a Mikrotik Router ====== ====== Reboot a Mikrotik Router ======
  
-===== CLI =====+===== Reboot Now =====
  
 <file> <file>
Line 11: Line 11:
 Many times, it is desirable to reboot a device later, at a scheduled time, to keep from inconveniencing users. Many times, it is desirable to reboot a device later, at a scheduled time, to keep from inconveniencing users.
  
-:!: We like to leave a 'Reboot' schedule in place on the device.  Then we can just change the date and/or time the next time we need to schedule a reboot.+:!: We like to leave a 'Reboot' schedule in place on the device.  Then we can just **change the date and/or time** the next time we need to schedule a reboot.
  
-Here is a one-time scheduled reboot:+Here is a **one-time scheduled reboot at 6:30pm**:
  
 <file> <file>
-/system scheduler add comment="Reboot the Mikrotik Router" name=Reboot \+/system scheduler add comment="Scheduled Reboot" name=reboot \
   on-event="/system reboot" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \   on-event="/system reboot" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
   start-date=nov/21/2016 start-time=18:30:00   start-date=nov/21/2016 start-time=18:30:00
Line 23: Line 23:
 :!: Periodic reboots **should not be necessary**.  If you feel a periodic reboot is necessary, you have a problem. :!: Periodic reboots **should not be necessary**.  If you feel a periodic reboot is necessary, you have a problem.
  
-Here is an example of a periodic reboot:+Here is an example of a **daily reboot at 12:10am**:
  
-/system scheduler add comment="Reboot the Mikrotik Router Daily" name=Reboot24 interval=24h \+<file> 
 +/system scheduler add comment="Scheduled Reboot Daily" name=Reboot24 interval=24h \
   on-event="/system reboot" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \   on-event="/system reboot" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
-  start-date=jan/01/1970 start-time=18:30:00+  start-date=jan/01/1970 start-time=00:00:10 
 +</file> 
 + 
 +===== Startup Notification ===== 
 + 
 +Edit this for the **destination e-mail address**, then paste it into a terminal to create a new schedule: 
 + 
 +<file> 
 +/system scheduler 
 +add name=reboot-notification comment="Send notification that the router was rebooted" on-event="delay 30\r\ 
 +      \n/log print file=logfile;\r\ 
 +      \ndelay 10\r\ 
 +      \n/tool e-mail send to=\"EnterEmailHere\" subject=\"\$[/system identity get name] - Rebooted at \$[/system clock get time] \$[/system clock get date]\" body=\"See attached log.\" file=\"logfile.txt\"\r\ 
 +      \ndelay 5\r\ 
 +      \n/file remove logfile.txt\r\ 
 +      \nlog info \"email sent and logfile deleted\"\r\ 
 +      \n/system routerboard settings set silent-boot=no" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive start-time=startup 
 + 
 +</file> 
networking/router/mikrotik_reboot.1479753519.txt.gz · Last modified: 2016/11/21 11:38 by gcooper