Site Tools


one_off_reboot

This is an old revision of the document!


One-off reboot (or any command really...)

You might want to perform, for example, a restart of your device. However, you might not be able to perform that action until a certain time, such as when users stop needing Internet connectivity, or until some other condition is met.

You might have noticed the option under Administration/Scheduler to reboot at specific time. However this is a periodic setting only, and will be saved in the device configuration. Thus, a reboot at 5:00 AM will be executed more frequently than you might want.

A simple solution to have a reboot performed once only is to add a command directly into the contable e.g.:

cru a reboot-one-off "0 5 * * * /sbin/reboot"


This command above will restart your device at 5am. The time syntax is the standard unix cron one.

NOTE: this is effective on a running device but not saved permanently anywhere in the config, hence after reboot the sheduled activity will automatically disappear (good!).

If you need to remove the scheduled activity for whatever reason, before it is executed, just use the following command:

cru d reboot-one-off


to verify use:

cru l
one_off_reboot.1629670681.txt.gz · Last modified: 2021/08/22 23:18 by hogwild