systemd

Running a Service at Fixed Intervals on Debian

There are many ways to run a service at fixed intervals on Debian, such as: cron, anacron, systemd timers, at, and sleep loop. This guide uses a systemd timer to run a script that keeps WireGuard (wg0) connected. Important: the script calls systemctl, which needs root privileges. Install the service and timer as system units (in /etc/systemd/system/, managed with sudo systemctl ...). Do not install them as user units (systemctl --user), or the script will fail with permission errors.