Automatic Node Reboot
Schedule your HamVOIP node to reboot itself on a regular basis using cron. A scheduled reboot clears out memory leaks and stuck connections so the node stays reliable. Click any command line to copy it.
Setup
- Open the terminal on your node (SSH in, or use the console).
-
Open the cron schedule for editing:
crontab -e -
After the last entry, add this line, replacing
<NODE#>with your node number:30 02 * * 2 /usr/local/sbin/reboot.sh <NODE#>This example reboots the node at 2:30 AM every Tuesday. - Save and exit. The new schedule takes effect right away. No reboot is needed.
-
Check that it saved by listing your cron jobs:
crontab -l
Build your reboot line
Pick when you want the node to reboot and the line is written for you.
Reading a cron line
A cron line is five time fields followed by the command to run:
30 02 * * 2 /usr/local/sbin/reboot.sh 12345 │ │ │ │ │ └── command to run (with your node number) │ │ │ │ └────── day of week (0–6, 0 = Sunday) │ │ │ └───────── month (1–12) │ │ └──────────── day of month (1–31) │ └──────────────── hour (0–23, 24-hour clock) └──────────────────── minute (0–59)
A * means “every.” So * * in the day-of-month and month spots means
“any day, any month,” and the day-of-week field narrows it down.
| Schedule | Cron line |
|---|---|
| Every day at 3:00 AM | 00 03 * * * /usr/local/sbin/reboot.sh <NODE#> |
| Every Sunday at 4:15 AM | 15 04 * * 0 /usr/local/sbin/reboot.sh <NODE#> |
| Monday & Thursday at 2:00 AM | 00 02 * * 1,4 /usr/local/sbin/reboot.sh <NODE#> |
| 1st of every month at 1:30 AM | 30 01 1 * * /usr/local/sbin/reboot.sh <NODE#> |
For anything fancier, crontab.guru lets you type a schedule and explains it in plain English.
Tips
Pick a quiet time. Early morning hours work best, so nobody gets cut off in the middle of a conversation or a net.
Cron uses the node's clock. Run date to see the
node's current time and time zone. If it shows UTC, adjust your hour to match (Central time is 5 or 6 hours behind UTC).
Once a week is usually plenty. Rebooting daily is fine on a node that has trouble, but most nodes run well with a weekly reboot.
To stop the automatic reboot, run crontab -e again and
delete the line, or put a # in front of it to turn it off for now.
Don't delete other lines in the crontab. HamVOIP uses it for its own scheduled jobs. Only add or change your reboot line.