On Thu, 26 Aug 2021 09:09:30 -0400
John Westerdale <jwesterd(a)redhat.com> wrote:
maybe ... rsync... rsync ... sync ... unmount?
On Thu, Aug 26, 2021 at 9:01 AM Geoffrey Leach <geoff(a)hughes.net>
wrote:
> On Thu, 26 Aug 2021 19:20:06 +0930
> Tim via users <users(a)lists.fedoraproject.org> wrote:
>
> > On Wed, 2021-08-25 at 21:21 -0700, 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.
> >
> > Just to be very clear:
> >
> > Have you issued a string of commands, so that you expect all the
> > copy commands to be executed in series before the unmount command
> > is issued? Write-caching can be a problem, though the system
> > shouldn't be unmounting before the cache is flushed.
> >
> > Or have you issued the copy and unmount commands, and hope that
> > the actual copying will hold the unmounting at bay until finished?
> > Parallel commands can be a problem, if you expect them to be
> > issued in one order, but they don't quite get queued up in the
> > way you expect.
> >
> >
> >
> > This sounds rather similar to the problem I've seen with with USB
> > flashdrives, and SD cards, where I've seen the message pop up on
> > the screen telling me it's okay to unplug the drive, but clearly
> > the data transfers actually haven't yet finished. In my case,
> > that would be some time after dragging and dropping files onto
> > the destination, then waiting what seemed a reasonable amount of
> > time before I right-clicked to eject or unmount the device
>
> copy ... copy ...umount
maybe ... rsync... rsync ... sync ... unmount?
Would certainly work, but would
rsync solve the problem?