Site Tools


Schedule a One-off Reboot (or any command really)

What if you wanted to perform, for example, a restart of your hardware device? However, you might not want to perform that action until some conditions is met. For example, when users stop needing Internet connectivity.

You might have noticed the option under Administration/Scheduler to reboot at a specific time. This is a periodic, permanent setting only, and will be saved in the device's configuration settings. 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 only once. FreshTomato includes a miniature version of the Linux crontable command, called “cru”.

The above can be done by adding a command directly into the crontable.

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:

This will take effect on a running device, but is not saved permanently in the configuration. Thus, after a reboot, the scheduled activity will automatically disappear, which is the desired goal in this case.

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

cru d reboot-one-off

To verify the schedule, use the “l” (list) parameter to list scheduled cron jobs:

cru l
one_off_reboot.txt · Last modified: 2021/09/13 16:55 by hogwild