Restore latest does not work if only one snapshot exists

Restoring latest repository with “restore latest” when only one snapshot exist. I have to use ID for restore. Error Message: “latest snapshot for criteria not found: no snapshot found”.

I’m unable to reproduce your problem with restic 0.12.1 and current master (as of writing this).

Please realize that a problem report lacking relevant information isn’t very useful. You should provide relevant information such as the exact command you ran as well as all of the output of it and the snapshots command :slight_smile:

FWIW I can successfully restore the latest and only snapshot using the restore command, see out below:

$ ./restic version
restic 0.12.1 (v0.12.1-0-gdc7a8aab) compiled with go1.16.3 on darwin/amd64

$ ./restic -r bepa snapshots
repository cca27d80 opened successfully, password is correct
ID        Time                 Host            Tags        Paths
------------------------------------------------------------------------------------------------------------
a24a3e05  2021-10-05 23:52:08  HOST                        /foo
------------------------------------------------------------------------------------------------------------
1 snapshots

$ ./restic -r bepa restore --target cepa latest
repository cca27d80 opened successfully, password is correct
restoring <Snapshot a24a3e05 of [/foo] at 2021-10-05 23:52:08.629555 +0200 CEST by USER@HOST> to cepa

I also tried the very same thing with the current master version of restic (restic 0.12.1 (v0.12.1-103-g24088f83) compiled with go1.16.3 on darwin/amd64) and it works fine too.

You should probably make sure that you’re using restic version 0.12.1, in case you’re on some old version.

1 Like

I’m running the latest version of restic but I use it with windows, running from an autohotkey script. As soon as a second snapshot exists, it works.

restic 0.12.1 compiled with go1.16.6 on windows/amd64

restic --cache-dir %A_ScriptDir%\cache --verbose=3 --password-file %A_ScriptDir%\password.txt -r %repository% restore latest --target %destination% --path “C:\xyplorer”

First of all, please don’t put the options to the command in the wrong order. You should follow the man page which specifies Usage: restic restore [flags] snapshotID, which means that the latest part in your command should come after the --target and --path options.

Second, you still haven’t provided the information I asked for in my previous reply. Please do, otherwise it’s hard to verify the presumed cause of your problem. If you don’t provide the information that people trying to help you kindly ask for, you’re making it very hard for them to be of service.

1 Like