Listing snapshots

The documentation says that restic -r /srv/restic-repo list snapshots should list all snapshots but I’m just getting

$ restic -r /path/to/my/repo list snapshots
enter password for repository: 
repository xxxxxxxx opened successfully, password is correct

on restic 0.9.6 compiled with go1.13.4 on linux/amd64.

So my question is:

Would restic mention this as well if no snapshot was found (i.e. no snapshot could be found)?

A quick test looks so for me.

root@:~# restic -r /tmp/test6 init
enter password for new repository: 
enter password again: 
created restic repository ce7486fa70 at /tmp/test6

Please note that knowledge of your password is required to access
the repository. Losing your password means that your data is
irrecoverably lost.
root@:~# restic -r /tmp/test6 snapshots
enter password for repository: 
repository ce7486fa opened successfully, password is correct
created new cache in /root/.cache/restic

So no information about empty repositories neither?
Wouldn’t it be useful if there would be such a message to avoid confusion?

For me it’s not an problem. But it can help some people.

You can fill an Feature request on https://github.com/restic/restic/issues

okay

But i have got this output on my server. Test for listing snapshots.

restic -r webseiten snapshots
enter password for repository: 
repository 30b3e317 opened successfully, password is correct
created new cache in /root/.cache/restic
ID  Time  Host        Tags        Paths
---------------------------------------
---------------------------------------
0 snapshots
root@:/home/# restic version
restic 0.9.4 compiled with go1.11.6 on linux/amd64

And now i am confused…

What was the other version, you tested? 0.9.6?

Yes, 0.9.6

root@:~# restic version
restic 0.9.6 compiled with go1.12.12 on linux/amd64

Maybe the functionality got broken on some point.
I also found out that the stale lock detection isn’t working anymore as well.

Maybe there are some tests missing that ensure this.

restic list snapshots is a rather low-level command that just outputs the full ids of the existing snapshots. If you want a user friendly output then restic snapshots is the right place. The output of the snapshots command has changed with the introduction of the group-by function in restic 0.9.5.

3 Likes