SaonBD | Paragraph logo

Subscribe to SaonBD | Paragraph

Get new posts delivered straight to your inbox.

All posts

Monitoring Borgmatic Backups on Linux

Check scheduled Borgmatic runs, read systemd logs, and receive alerts when backups fail.

Monitoring Borgmatic Backups on Linux

A scheduled backup is useful only if it runs and completes. This guide shows how to check the Borgmatic systemd timer, inspect recent runs, and receive an alert when a backup fails.

It builds on the Borgmatic setup in Automated Server Backups with BorgBackup and Borgmatic on Linux. The exact unit names can vary by distribution. Check the installed units before you use these commands.

Check the timer

List the timer and its next scheduled run:

sudo systemctl list-timers --all borgmatic.timer

Check whether the timer is enabled and active:

sudo systemctl status borgmatic.timer

list-timers shows the last and next activation times. If the timer is missing or inactive, check the Borgmatic package for its systemd unit files. Some installations use a different unit name or require a timer to be enabled.

Check recent backup runs

Read the service journal:

sudo journalctl -u borgmatic.service --since "24 hours ago"

Show the latest service invocation and its result:

sudo systemctl status borgmatic.service

Look for a failed service result, an error from Borgmatic or Borg, or a run that did not occur when expected. A timer can be active while a backup itself fails, so check both units.

For more detail, show the service logs without paging:

sudo journalctl -u borgmatic.service --since "24 hours ago" --no-pager

Configure a health-check alert

Borgmatic supports health-check hooks, including Healthchecks.io. Create a check in the monitoring service, then add its ping URL to the existing hooks section in your Borgmatic configuration. Do not replace other hooks already in that section.

hooks:
  healthchecks: https://hc-ping.com/your-check-uuid

Replace the example URL with the URL issued for your check. Treat it as a secret. Anyone with the URL may be able to send status pings to that check.

Borgmatic sends health-check status updates for the backup run. The monitoring service can alert when it does not receive the expected successful check-in. Set the check's period and grace time to match your timer schedule. For a daily timer, allow enough grace time for a late run to finish before sending an alert.

Health-check options and configuration schema can vary between Borgmatic versions. Check the documentation for your installed version and validate the configuration before relying on it:

sudo borgmatic config validate

A valid configuration confirms its syntax. It does not confirm that the remote monitoring service can receive a ping.

Test delivery

Run Borgmatic manually, then open the check in your monitoring service and confirm that it records the run. Check the service journal if the check does not update:

sudo borgmatic --verbosity 1
sudo journalctl -u borgmatic.service --since "15 minutes ago"

For an end-to-end failure test, use the monitoring service's test function or a separate test check. Do not deliberately break a production backup configuration. Confirm that the expected alert arrives before treating monitoring as complete.

Investigate a failed run

Start with the service journal. Find the first error in the run, then check the related condition:

  • For a repository or network error, verify that the destination is reachable and that the backup account can authenticate.

  • For a permission error, check that the service runs with access to the configured source paths and credentials.

  • For a configuration error, run borgmatic config validate and correct the reported key or value.

  • For a storage error, check available space on the backup destination.

After fixing the cause, run Borgmatic manually and confirm that the run succeeds. Then verify the new journal entry and the health-check update. Do not clear an alert until a successful backup is confirmed.

Related guides

Join the discussion

Have a thought or a correction? Send it over — your message opens in your email app.

Subscribe

Get new posts delivered to your inbox.