How to tell if the sync is complete for a folder from bash

Recommended Posts

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?

Link to comment
Share on other sites

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.)

Link to comment
Share on other sites

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.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.