====== Reboot a Mikrotik Router ======
===== Reboot Now =====
/system reboot
===== Scheduled Reboot =====
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.
Here is a **one-time scheduled reboot at 6:30pm**:
/system scheduler add comment="Scheduled Reboot" name=reboot \
on-event="/system reboot" policy=ftp,reboot,read,write,policy,test,password,sniff,sensitive \
start-date=nov/21/2016 start-time=18:30:00
:!: Periodic reboots **should not be necessary**. If you feel a periodic reboot is necessary, you have a problem.
Here is an example of a **daily reboot at 12:10am**:
/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 \
start-date=jan/01/1970 start-time=00:00:10
===== Startup Notification =====
Edit this for the **destination e-mail address**, then paste it into a terminal to create a new schedule:
/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