restic-backup-suite: Monitoring
Monitoring restic-backup-suite: success marker file, log files and exit codes. There are no built-in email or webhook notifications.
Monitoring
restic-backup-suite sends no notifications itself (no email, no webhook). For monitoring there is the marker file, the log files and the exit code.
Success marker
After a successful run, backup.sh writes an ISO 8601 timestamp (seconds, with time zone) to the file SUCCESS_MARKER_FILE. Default: /var/backup/.last_restic_success.
- The directory is created if needed. The file gets mode 600.
- The marker is written after
restic backup, retention and the integrity check. - With
--dry-runand--dump-onlyit is not written. - An empty value (
SUCCESS_MARKER_FILE="") does not disable the marker: the script then falls back to the default path/var/backup/.last_restic_success. The marker cannot be turned off through the configuration. - If the file cannot be written, the script logs a warning. The exit code does not change.
An external tool checks the file's age against your backup interval. Example for daily backups:
find /var/backup/.last_restic_success -mmin +1440 | grep -q . && echo CRITICAL || echo OK
A stale marker means either the backup failed or the marker could not be written. The log tells you which.
The marker confirms that
restic backupsucceeded. It says nothing about whether all database dumps worked, see Database dumps.
Log files
| Script | File |
|---|---|
backup.sh |
<LOG_DIR>/backup-YYYY-MM-DD.log |
restore.sh |
<LOG_DIR>/restore-YYYY-MM-DD.log |
inspect.sh |
<LOG_DIR>/inspect-YYYY-MM-DD.log |
| Cron job (output) | /var/log/restic/cron.log |
- Each line has the format
[YYYY-MM-DD HH:MM:SS] [INFO|WARN|ERROR] message. Errors also go to stderr. - Until the configuration is loaded, the scripts write to
/tmp/<script>-YYYY-MM-DD.log. - There is one file per day, several runs on the same day append to it. There is no rotation, clean up old logs yourself.
tail -100 /var/log/restic/backup-$(date +%Y-%m-%d).log
Exit codes
| Code | Meaning |
|---|---|
| 0 | Run successful |
| non-zero (usually 1) | Error: configuration missing, not root, restic missing, SFTP test or repository init failed, restic backup failed, unknown option |
Warnings do not change the exit code: a failed retention step, an integrity check with findings, a service that fails to start, an unwritable marker and failed database dumps in a regular backup run.