Site Tools


one_off_reboot

This is an old revision of the document!


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

What if you want to perform, for example, a restart of your hardware 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 there is an option under Administration/Scheduler to reboot at a specific time. However this is a periodic setting only, and will be saved in the device configuration. Thus, a reboot at 5:00 AM might be executed more frequently than you might want.

A simple solution to this is to have a reboot performed once only. This can be done by adding a command directly into the contable.

For example:

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


This command would restart your device at 5:00 AM. The standard Unix cron syntax is used here: cron .

NOTE: this is effective on a running device but not saved permanently anywhere in the configuration. Thus, after reboot the scheduled activity will automatically disappear, which is what is wanted in this case.

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.1629671108.txt.gz · Last modified: 2021/08/22 23:25 by hogwild