Force a sync after each file copy

Paolo Bolzoni paolo.bolzoni.brown at
Wed Jun 11 05:05:37 MDT 2014

Dear list,

I often copy files from the hard disk to an usb key
using rsync:

rsync -Pr <from> <to>

It works fine, but the -P is fairly useless since most of the
copy is actually made when unmounting the usb keys. In the case
of big files it might means minutes of working.

So I usually put along the command a && sync, so I am fairly sure
that the unmounting will be quick.  It works, but it also make
the -P option useless.

Is there an option of rsync to force a sync call after each file
copy? unfortunately I cannot simply use the flush or sync mount
option since I am not using fat.

If the option is not there it would be possible to add it? If
needed I am a C programmer, so if pointed in the right part of
the code I can probably do a pull request.

Your faithfully,

More information about the rsync mailing list