Site Tools


one_off_reboot

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
one_off_reboot [2020/08/28 12:43] rs232one_off_reboot [2023/05/23 19:46] – -formatting hogwild
Line 1: Line 1:
-====== One-off reboot (or any command really...) ======+====== Schedule a One-off Reboot (or any other command) ======
  
-You might find yourself in the position where you need to e.g. restart your device but you're not able to do so until a certain time because users need Internet connectivity or else…+What if you wanted to perform, for example, a restart of your hardware device? You might not want to perform that action until some conditions are met. For example, when users stop needing Internet connectivity.
  
-You might have noticed under Administration/Scheduler an option to reboot at specific time however this is a periodic setting only and will be saved in the device configSo a reboot at 5am will have to come with a frequency of execution which you might not want.+You might have noticed the option under //Administration///[[admin-sched|Scheduler]] to reboot at specific time. This is a periodic, permanent setting only. It will be saved in the device's configuration settingsreboot at 5:00 AM might be executed more frequently than you wish.
  
-A simple solution to have a reboot performed once only is to add command directly into the contable e.g.:+A simple solution to this is to configure a reboot to be performed only once. FreshTomato includes miniature version of the Linux crontable command, called "cru".
  
-<code> +You can arrange the the above by adding command directly into the crontable.
-cru reboot-one-off "0 5 * * * /sbin/reboot"+
  
 + \\
 +
 +For example:
 +
 + \\
 +
 +<code ->
 +cru a reboot-one-off "0 5 * * * /sbin/reboot"
 </code> </code>
  
-This command above will restart your device at 5am. The time syntax is the standard unix [[https://en.wikipedia.org/wiki/Cron|cron]] one.+ \\ This command would restart your device at 5:00 AM.
  
-NOTEthis is effective on a running device but not saved permanently anywhere in the config, hence after reboot the sheduled activity will automatically disappear (good!).+The standard Unix cron syntax can be found here[[https://en.wikipedia.org/wiki/Cron|cron]]
  
-If you need to remove the scheduled activity for whatever reasonbefore it is executedjust use the following command: +This command will take effect on a running device, but would not be saved permanently in the configuration. Thus, after a reboot, the scheduled activity would automatically disappearwhich in this caseis the desired result.
-<code>+
  
-cru d reboot-one-off+ \\
  
 +If you need to remove the scheduled activity before it is executed, use the following command:
 +
 + \\
 +
 +<code ->
 +cru d reboot-one-off
 </code> </code>
  
-to verify use:+ \\  To verify the schedule, use the "l" (list) parameter to list scheduled cron jobs:
  
-<code> + \\
-cru l+
  
 +<code ->
 +cru l
 </code> </code>
 +
 + \\
 +
 + \\
  
  
one_off_reboot.txt · Last modified: 2023/05/23 19:47 by hogwild