systemd can run your health check without cron: a oneshot .service plus a .timer is the clean Ubuntu pattern.
Steps
Create (or reuse) a health script:
sudo tee /usr/local/bin/vps-health.sh >/dev/null <<'EOF'#!/bin/bashecho "=== $(date -Is) $(hostname -f) ==="uptimefree -hdf -hT /EOFsudo chmod +x /usr/local/bin/vps-health.shDefine the oneshot service:
sudo tee /etc/systemd/system/vps-health.service >/dev/null <<'EOF'[Unit]Description=VPS health snapshot[Service]Type=oneshotExecStart=/usr/local/bin/vps-health.shEOFDefine the hourly timer and enable it:
sudo tee /etc/systemd/system/vps-health.timer >/dev/null <<'EOF'[Unit]Description=Run VPS health hourly[Timer]OnCalendar=hourlyPersistent=true[Install]WantedBy=timers.targetEOFsudo systemctl daemon-reloadsudo systemctl enable --now vps-health.timersystemctl list-timers | grep vps-healthRun once manually and read the journal:
sudo systemctl start vps-health.servicesudo journalctl -u vps-health.service -n 50 --no-pager
Tips
- Prefer timers over cron when you already live in systemd — restarts and logs stay unified.
- You can extend the script to email on thresholds.
ext step
Stable services on your own VPS: Deploy your Cloud VPS.