G.M.R.S Link Back

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

  1. Open the terminal on your node (SSH in, or use the console).
  2. Open the cron schedule for editing: crontab -e
  3. 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.
  4. Save and exit. The new schedule takes effect right away. No reboot is needed.
  5. 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.

ScheduleCron line
Every day at 3:00 AM00 03 * * * /usr/local/sbin/reboot.sh <NODE#>
Every Sunday at 4:15 AM15 04 * * 0 /usr/local/sbin/reboot.sh <NODE#>
Monday & Thursday at 2:00 AM00 02 * * 1,4 /usr/local/sbin/reboot.sh <NODE#>
1st of every month at 1:30 AM30 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.