Command for verifying the last ok snapshot time

Hi all:

Working on OSX, there is no straight forward way to keep a client initiated backup routine, I’m about to launch a periodic bash script via cron. This script has to obtain the last ok Snapshot, and then if it’s older than X hours/days, run another one.

I’m able to list the snapshots but not when were it taken.

Can anyone point me the way of getting the time of the last snapshot?

Thanks

snapshots --json latest will output a JSON structure representing the last snapshot taken on the current host. You can extract the time with the jq command-line utility, or you could script in an environment that can parse JSON itself.

# restic snapshots --json latest | jq -r '.[0].time'
2021-02-22T02:00:18.881060154-05:00
1 Like

ohhh nice

Thanks!

1 Like