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

feature request: Don't update xattrs for unmodified files #23

Open
eatnumber1 opened this issue Aug 7, 2023 · 6 comments
Open

feature request: Don't update xattrs for unmodified files #23

eatnumber1 opened this issue Aug 7, 2023 · 6 comments

Comments

@eatnumber1
Copy link

I'd like to use hashrat on a cron job to update a very large directory tree of rarely changing files.

When running

strace hashrat -sha512 -r d -xattr -cache

I see that hashrat updates the xattr even on unmodified files (e.g. the mtime in the xattr is more than 10s newer than the mtime of the file). This means that when scanning large directory trees of unmodified files, hashrat will still modify the xattr of every one of those files.

@ColumPaget
Copy link
Owner

Hi eatnumber1, I'll make some time to look into this over the Xmas period. I think there was some kindof idea with hashrat that it would use xattr to mark files with a 'last considered time', but I'm not sure as xattr isn't one of the features I commonly use these days. I think hashrat could do with a bit of a wash-and-brushup anyways, it's been a while since I've had cause to go into the code.

@ColumPaget
Copy link
Owner

Hi eatnumber1. I've finally got around to taking a look at hashrat. With this request, is the aim to save time by not updating unmodified files, or is it just to not touch the filetimes? I'm guessing it's the latter because we'd have to hash the file anyways in order to know for sure that it's not modified?

@eatnumber1
Copy link
Author

eatnumber1 commented Jun 21, 2024

It's the latter. I don't want my backup software trying to back them up unless they've changed.

@ColumPaget
Copy link
Owner

Okay, I'll try and get that added for the next release.

@ColumPaget
Copy link
Owner

New release has the feature. I went with your example command-line, so using '-cache' prevents unchanged files from being updated.

Sorry it took so long. It's been a busy year.

@ColumPaget
Copy link
Owner

Does the new release fit your use case?

Colum

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

2 participants