borgmatic

🚨 How to monitor your backups

πŸ”

Having backups is great, but they won't do you a lot of good unless you have confidence that they're running on a regular basis. That's where monitoring and alerting comes in.

There are several different ways you can monitor your backups and find out whether they're succeeding. Which of these you choose to do is up to you and your particular infrastructure:

Scripting borgmatic

To consume the output of borgmatic in other software, you can include an optional --json flag with create, repo-list, repo-info, or info to get the output formatted as JSON.

Note that when you specify the --json flag, Borg's other non-JSON output is suppressed so as not to interfere with the captured JSON. Also note that JSON output only shows up at the console and not in syslog.

Latest backups

All borgmatic actions that accept an --archive flag allow you to specify an archive name of latest. This lets you get the latest archive without having to first run borgmatic repo-list manually, which can be handy in automated scripts. Here's an example:

borgmatic info --archive latest

Improve this documentation

Have an idea on how to make this documentation even better? Use our issue tracker to send your feedback!