Structured dump of metadata / index

restic version: restic 0.17.1-dev (v0.17.1-152-gefec1a5e9-dirty) compiled with go1.23.2 on linux/amd64

I have been looking at Structured dump of metadata / index · Issue #4341 · restic/restic · GitHub. I have developed a first darft at Enhancement request: Structured dump of metadata / index by wplapper · Pull Request #19 · wplapper/restic · GitHub.

I the question I would like to pose is:
What relationship tables would you like to see? So far I have implemented showing snapshots
{ "snapshots": [ { "snapID": "916169a3d43a110783b29109b7e7a35602031706d3697e4649076093b53be692", "short": "916169a3", "snapdata": { "time": "2024-10-08T14:48:40.805757983+01:00", "parent": "b11a70b0907b29ed6ea0e9158441ea82cac78408d318fbab2772341588fb6aa6", "tree": "6048a48543deeba5aad4b5908b91e07e57b3d58ea0d6f9cf7708e05ec6d9a7ac", "paths": [ "/home/wplapper/restic/restic_cmd_rewrite_include/cmd/restic" ], "hostname": "XPS-15-9550", "username": "wplapper", "uid": 1000, "gid": 1000, "program_version": "restic 0.17.1-dev (v0.17.1-158-gd76522d3c-dirty)", "summary": { "backup_start": "2024-10-08T14:48:40.805757983+01:00", "backup_end": "2024-10-08T14:48:41.511930704+01:00", "files_new": 0, "files_changed": 0, "files_unmodified": 4, "dirs_new": 0, "dirs_changed": 6, "dirs_unmodified": 0, "data_blobs": 0, "tree_blobs": 7, "data_added": 3808, "data_added_packed": 2283, "total_files_processed": 4, "total_bytes_processed": 7681 } } } ] },

index entries:
{ "index": [ { "id": "b796aad02a4924475f3a9a612435d78bf68cf35aa00efcd5cfaf6ae385093abd", "type": "data", "offset": 0, "length": 115, "uncompressed_length": 74 } },

meta file (tree) entries:
{ "file-meta-data": [ { "id": "6048a48543deeba5aad4b5908b91e07e57b3d58ea0d6f9cf7708e05ec6d9a7ac", "path": "/", "nodes": [ { "name": "home", "type": "dir", "mode": 2147484141, "mtime": "2024-05-06T19:58:42.990470252+01:00", "atime": "2024-05-06T19:58:42.990470252+01:00", "ctime": "2024-05-06T19:58:42.990470252+01:00", "uid": 0, "gid": 0, "user": "root", "group": "root", "inode": 2, "device_id": 66307, "content": null, "subtree": "e8be2792fa3465da10a7132ba0aba0c41a9b21106b9e7a7ba264a592b1ebdf76" } ] } }

1 Like

sorry, I was too quick to click on “create …”

In addition, a child/parent relationship:
"parent-child-map": [ { "parent": "e8be2792fa3465da10a7132ba0aba0c41a9b21106b9e7a7ba264a592b1ebdf76", "children": [ "a8dadb4fde9fdf8b34da2cb6cf56df958ce86a40bce81e5da74224adbb01e00e" ] }, ]

and relationship between data blobs and where they are used:
"datablob-table": [ { "datablob": "49ed1312943d627b0d891305d9c8b91bebf8fc888727711ac7e05616c1b2e851", "snapid": "916169a3d43a110783b29109b7e7a35602031706d3697e4649076093b53be692", "metablob": "6eac3ddbe2556998fd786178103457acecc9668fe4e0b3e0f2172d260a3e16f4", "position": 3, "offset": 0 }],
whereby position is the index into the meta data (tree.Nodes) table and offset is the index into the node.Content slice.

A relationship for packfiles (id, their length, type, number of entries) can easily be devoled.