On Wed, 25 Aug 2021 21:26:19 -0700
Samuel Sieb <samuel(a)sieb.net> wrote:
On 8/25/21 9:21 PM, Geoffrey Leach wrote:
> I have a script that mounts an MP3 device, copies files and
> umounts. As I have counted on the umount to hang until the data
> transfer is complete. That has worked fine until recently. Now the
> umount finishes, leaving much of the data uncopied.
You're saying that the copy command has finished and then it runs
umount? umount will certainly wait until the data is flushed.
What's missing on the destination? Is the filesystem corrupted?
> Has some parameter been changed inadvertently? Or was I just lucky,
> and my luck has run out? If so, is there a way to test for the real
> end of transfer?
You could add a "sync" after the copy and before the "umount".
Just what I needed. Thanks.