why does this rsync commands copy again the same files?
Gordon Messmer
yinyang at eburg.com
Thu Nov 22 22:32:56 UTC 2012
On 11/22/2012 01:55 PM, M. Fioretti wrote:
> However, I do remember that this thing of having the trailing slash in
> the source, but not in the destination, is something I have read in
> many places as the thing to do, and this is the first time I hear
> speaking against it.
The man page for rsync is clear on the topic:
"""
A trailing slash on the source changes this behavior to avoid creating
an additional directory level at the destination. You can think of a
trailing / on a source as meaning "copy the contents of this directory"
as opposed to "copy the directory by name"
"""
Putting a trailing slash on both directories will produce exactly the
same behavior as not putting a trailing slash on the destination.
Suggestions otherwise are mistaken. Putting a slash on both is very
common, since it relieves users of needing to understand the more
specific details of this behavior.
> Back on topic, why do you think there may be some link between this
> issue and the problem I see? My problem seems more due to some wrong
> option, because a) it is the only problem I see, never had any filled
> partition, and b) it is very, very constant. Sorry if I forgot to
> specify this earlier, but if I run the command on two different
> drives, both vfat, both times the folder(s) that are recopied are the
> same.
Use --modify-window=1
vfat's time resolution is only 2 seconds, so about half of original
files copied to vfat using rsync will have a timestamp that doesn't
match. Since rsync uses size and modified time to decide whether or not
to copy files (unless you specify -c), about half of your files will be
rsynced every time you copy from ext4 to vfat.
More information about the users
mailing list