Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to differentiate changed files (with metadata changes) from changed files (without metadata changes) based on exit code #35

Open
azurefreecovid opened this issue Jun 10, 2020 · 0 comments

Comments

@azurefreecovid
Copy link

Thanks for the great software. Scorch is fantastic!

I've been trying Scorch on a system where I have lots of legitimate changes on the filesystem that I'm running it on, but also want to be able to detect bitrot on files that are mixed in that don't change.

I'm scripting the use of Scorch and deciding what to do based on the exit code I receive back from Scorch.

Is there anyway to distinguish between files that have legitimately changed on the file system (I'm happy to ignore these), vs bitrot that I do care about? At the moment both seem to result in a exit code of 4 from Scorch and it makes it difficult for me to distinguish between the two use cases.

I realise that the log messages do show the difference, but for follow on processing I'd really like the distinction to come from the exit codes.

Would it be possible to add an additional exit code that is just for file changes without the metadata changing?

My current workflow is (feel free to let me know if I'm using Scorch wrong):

scorch -D 'size,mtime' -d ./scorch.db check+update /data
scorch -D 'size,mtime' -d ./scorch.db append /data
scorch -D 'size,mtime' -d ./scorch.db cleanup /data

I have tried running scorch update then scorch check but in the intervening period the files can change so I still get errors.

If you didn't like the idea of a separate error code for file corruption, rather than file changes and corruption, would it be possible to add new command scorch update+check which updates the metadata first and then does the hash check?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant