Hey Joey, Is there a way to see when the last fsck was? I know about --incremental and the related options, but sometimes I'd like to know when the last time I fsck'd a file (or even the whole repo) was. There doesn't seem to be a command line option for it, but I know that info is saved somewhere...maybe this could be part of 'git annex status'?
$(words of gratitude and encouragement)
You're quite right. that info is stored in
.git/annex/fsckstate
. The timestamp of the file is when the last incremental fsck was started. The contents of the file is the same date, represented as seconds from epoch.That is only written to when doing an incremental fsck though. A non-incremental fsck does not touch the file.
From one of my repositories (UUIDs redacted, I doubt that's required but better safe than sorry):
Those appear to be Unix timestamps, easily converted to human-readable with, e.g.,
date -d @TIMESTAMP
(without thes
at the end; at least with GNU date). E.g., the last one becomes Sat Nov 4 16:46:29 EDT 2017.Sometimes there are multiple lines per-repository; not sure what determines how long they're kept. Before running
git-annex sync
, this one had dozens of lines of history; sync cleaned it up. Of course, those lines of history remain in the git history.That was implemented for a different use-case (
git-annex expire
) but you can certianly use it to keep track of the last time some fsck, perhaps a partial one, was run on a repository.