Hi
Im dumping the latest snapshot date to an file, like so.
restic snapshots latest |head -n3 |tail -n1 |awk '{print $2}' > /tmp/test
But when I do so, restic will not remove the lock file. I found its sufficient for this behaviour, that only the |head part, like so
restic snapshots latest |head
What is the reason for this ? And/Or, what would be an proper way of getting the date of the latest snapshot ? Moving the lock manually every time doesnt feel sane.
Full example
root@myserver:~# restic version
restic 0.16.4 compiled with go1.21.6 on linux/amd64
root@myserver:~# restic list locks
repository NNNNN opened (version 2, compression level max)
root@myserver:~# restic snapshots latest |head
ID Time Host Tags Paths
-----------------------------------------------------------------------------------------------------------------------------------------------
NNNNN 2024-08-09 02:00:01 myserver.local.example.com cron /etc/folder1
/etc/folder2
/etc/folder3
/etc/folder4
/etc/folder5
/etc/folder6
/etc/folder7
/etc/folder8
root@myserver:~# restic list locks
repository NNNNNN opened (version 2, compression level max)
74d98cNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN441