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

Syncing an existing file will change its inode #2845

Closed
fearenales opened this issue Mar 17, 2016 · 6 comments
Closed

Syncing an existing file will change its inode #2845

fearenales opened this issue Mar 17, 2016 · 6 comments
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Comments

@fearenales
Copy link

When a file is synced from an origin, its inode changes.

This means if I'm running an tail -f on that file, it will break. If I'm running tail -F, the whole file content is prompted.

Is there any possible way to force Syncthing to preserve the file inode?

Version Information

Syncthing Version: v0.12.20
OS Version: Mac OS X Yosemite (running Syncthing in a Docker container)

@wweich
Copy link
Member

wweich commented Mar 17, 2016

No. Syncthing always creates a new file, copies as much data from local and the rest from remote, and if it is sure the new file is correct, the old file is deleted and the new file is moved/renamed.

@canton7
Copy link
Member

canton7 commented Mar 17, 2016

... Which gives you atomic file updates.

@calmh
Copy link
Member

calmh commented Mar 17, 2016

Yes. This is as intended. We never alter a file in place, for good and bad. There's a discussion (somewhere, I can't find it right now) and an idea (https://github.com/syncthing/syncthing/wiki/In-Place-Updates) for how to do in place updates, but this is not in the roadmap for now. In any case it would seldom be as clean as a straight append of data to a file to make your tail -f happy. Sorry.

@calmh calmh closed this as completed Mar 17, 2016
@AudriusButkevicius
Copy link
Member

Why don't you just use -F, which follows file name and not inode? I don't think asking to change syncthing to work around deficiencies of tail is the right way to go.

@fearenales
Copy link
Author

@AudriusButkevicius Please, don't get me wrong. I'm not asking for a change on Syncthing, I just wondered if there was an existing way to do that. Btw, I've pointed the downsides of using tail -F.

But that's a minor case for me, no worries. Syncthing is an awesome tool! Great job! :)

@fearenales
Copy link
Author

Thank you all guys for the explanation! 😄

@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jun 16, 2017
@syncthing syncthing locked and limited conversation to collaborators Jun 16, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion
Projects
None yet
Development

No branches or pull requests

6 participants