Created
May 18, 2017 18:03
-
-
Save fd0/6ad6f434548337f785694d5d592caf9d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
snapshots=$(restic snapshots --json | jq --raw-output '.[].id') | |
for id in $snapshots; do | |
tree=$(restic cat snapshot $id | jq --raw-output .tree) | |
name=$(restic cat blob $tree | jq --raw-output '.nodes[0].name') | |
blobs=$(restic cat blob $tree | jq --compact-output '.nodes[0].content') | |
echo "{'id': '$id', 'name': '$name', 'content': $blobs}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment