Im trying to get the snapshot-id of a new backup that I made using SFTP, but I only get an empty string:
restic -r sftp:user@server:“resticFiles/backup” list snapshots
repository ff1234ea opened (repository version 2) successfully, password is correct
If I issue the check command like this, the repository seems to be healthy:
restic -r sftp:user@server:resticFiles/backup check
using temporary cache in /tmp/restic-check-cache-594643679
repository ff1234ea opened (repository version 2) successfully, password is correct
created new cache in /tmp/restic-check-cache-594643679
create exclusive lock for repository
load indexes
check all packs
pack 12c39b9905f029e1990f5531bd30efd81620e6ca7596044b7ca042149cca8b7c: not referenced in any index
[…]
85 additional files were found in the repo, which likely contain duplicate data.
This is non-critical, you can run restic prune to correct this.
check snapshots, trees and blobs
[0:00] 0 snapshots
no errors were found
If the check command succeeds, there should be a snapshot-id too, but why does the list command not return it?
This output from your check suggests that there is really 0 snapshots in the repository. Can you please show the backup command you ran and all of its output? At the end of the backup run it tells you the ID of the snapshot that was saved.
The output of your snapshots command makes me think that you ran a backup that was never completed. You can try to run the same backup command again and make sure it completes, then you should get a snapshot ID.
Thank you for the hint – I was using a backup script from within the container lobaro-restic,
which just reported “finished backup” after runnig for some time that seemed reasonable to me.
But thanks to your hint I found the culprit in /var/log/backup-last.log:
subprocess ssh: client_loop: send disconnect: Broken pipe
error while unlocking: ssh command exited: exit status 255 Fatal: unable to save snapshot
I will restart the backup now, and check the log file
Ah, how unexpected. Might want to make sure that you somehow find a way to inspect logs or at know that the backups completed as they should, it seems that this script hides this from you.
Yes, you live and learn I wouldnt expect such a behaviour too.
It was your clear diagnosis that pointed me to the log file, and now I wont forget about it