Aaron Ellington Posted August 30, 2016 Report Share Posted August 30, 2016 Is it possible to tell is a folder is fully synced/currently syncing or not from command line/bash? Background: My shared folders are zfs filesystems on my Ubuntu 16.04 server and I want to setup a cron job to take a zfs snapshot as long as a btsync is not currently syncing with a peer. Thanks in advance for your help! Quote Link to comment Share on other sites More sharing options...
YI WANG Posted August 31, 2016 Report Share Posted August 31, 2016 I am not a professional user but to share my thinking. I think you could first to pausing the sync and then take snapshot of those folders without tmp sync file ext names...Yes, but for those files got not synced yet.. this method is not ideal... Quote Link to comment Share on other sites More sharing options...
Aaron Ellington Posted August 31, 2016 Author Report Share Posted August 31, 2016 10 hours ago, YI WANG said: I am not a professional user but to share my thinking. I think you could first to pausing the sync and then take snapshot of those folders without tmp sync file ext names...Yes, but for those files got not synced yet.. this method is not ideal... That may be something though. I can have my script check to see the the directory has any files with the .bts extension before taking the zfs snapshot. I think that would work just fine. I'll test it out and let you know if that works well enough or not. From looking at on of my shares it appears that .bts is a tmp extension. Is that the only one I should check for, or are there more? Quote Link to comment Share on other sites More sharing options...
Helen Posted August 31, 2016 Report Share Posted August 31, 2016 @Aaron Ellington, I think I must warn you, that in Resilio Sync v.2.4 those temp files (rsls, formerly bts) will no longer appear in the folder until the file is fully downloaded. So your script won't help there. Quote Link to comment Share on other sites More sharing options...
iswrong Posted August 31, 2016 Report Share Posted August 31, 2016 Also, doing this introduces races. What if a file starts syncing in a directory while you are checking for temporary files. Did you consider stopping/starting via your init system? Quote Link to comment Share on other sites More sharing options...
Aaron Ellington Posted August 31, 2016 Author Report Share Posted August 31, 2016 @Helen Where will the partial downloads be stored in 2.4 and above? @iswrong I can stop it before taking the snapshot then start it again. But I would still have the problem of stopping the sync while it's in the middle of syncing. How would you solve that problem? Quote Link to comment Share on other sites More sharing options...
iswrong Posted August 31, 2016 Report Share Posted August 31, 2016 1 hour ago, Aaron Ellington said: @iswrong I can stop it before taking the snapshot then start it again. But I would still have the problem of stopping the sync while it's in the middle of syncing. How would you solve that problem? I would think (but didn't check) that Sync would exit gracefully when it receives a SIGTERM signal. (As in: the sync may not be complete, but everything is in a consistent state.) Quote Link to comment Share on other sites More sharing options...
Helen Posted September 1, 2016 Report Share Posted September 1, 2016 @Aaron Ellington, it'll be done through .sync/XXX.!sync temp file. But also in this format Sync will keep xattrs in .sync/Streams/XXX.!sync if the local file system does not support streams Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.