Script, command to check for last run of job

Is there a command I could run against restic to check when last backup occurred, or number of snapshots since a date.

Just found that because a container was doing my backups where not running since the 13/th August. So something I could run daily to show me number of backups today, or last backup of a tag and send me a warning if there are none today.

You can write a little script that checks the output of the snapshots command in json format

restic snapshots --json --latest 1

Or you can use a wrapper available for restic.

Many of the restic wrappers (like resticprofile ← I made this one) can run commands after a success or a failure, and/or can send requests to third party websites like healthchecks.io so it gives you many possibilities :+1:

Thanks. Yeah the resticker wrapper im usi n does have an on failure command. But what I’m finding if the backup container is dropping.

So it’s not firing commands.

I might look at health checks. Also might look at firing annotations into influxdb and using it’s alerting

Other options are to scan the snapshots/ folder in your repository to see when the most recent file was created. Clearly this is depending on date+time being accurate and even if you see a new snapshot file it doesn’t mean that an attacker didn’t just change your backup set to be practically empty. But if you just want to know if restic ran and created a snapshot, it works.

Other than that, don’t you have logs that you can ingest somewhere to keep track of it?