This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
one_off_reboot [2021/08/22 23:25] – hogwild | one_off_reboot [2024/10/31 21:41] (current) – hogwild | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== One-off | + | ====== |
- | 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. | + | What if you wanted |
- | You might have noticed | + | You might have noticed |
- | A simple solution | + | A simple solution is to configure |
+ | |||
+ | You can arrange the the above by adding a command directly into the crontable. | ||
+ | |||
+ | \\ | ||
For example: | For example: | ||
- | < | + | \\ |
- | cru a reboot-one-off "0 5 * * * / | + | |
+ | <code -> | ||
+ | cru a reboot-one-off "0 5 * * * / | ||
</ | </ | ||
+ | |||
+ | \\ This command would restart your device at 5:00 AM. | ||
+ | |||
+ | It would take effect on a running device, but wouldn' | ||
+ | |||
\\ | \\ | ||
- | This command would restart your device at 5:00 AM. The standard Unix cron syntax is used here: [[https:// | ||
- | 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. | + | The standard Unix cron syntax can be found here: [[https:// |
- | 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 | + | If you need to remove the scheduled activity before it is executed, use the following command: |
+ | \\ | ||
+ | |||
+ | <code -> | ||
+ | cru d reboot-one-off | ||
</ | </ | ||
+ | |||
+ | \\ \\ To verify the schedule, use the " | ||
+ | |||
\\ | \\ | ||
- | to verify use: | ||
- | < | + | < |
cru l | cru l | ||
- | |||
</ | </ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||
+ | |||
+ | \\ | ||