rsync not updating files even with checksum flag

Tony Abernethy tony at servacorp.com
Mon Nov 6 23:10:18 GMT 2006


Cheap shot that might be effective.  Something like this might work.

On the samba share,
after the rsync has finished,
run a script that touches any file that was last modified in the last few
minutes.
This marks files that should be retransmitted because they might have
    their contents changed without the directory entry being changed.

Basically you want to run rsync on the file while windows is writing to the
file
and then (once) run rsync on the file after window has finished.

It's a fundamental difference in approach :: windows : unix

  -----Original Message-----
  From: rsync-bounces+tony=servacorp.com at lists.samba.org
[mailto:rsync-bounces+tony=servacorp.com at lists.samba.org]On Behalf Of Mark
Osborne
  Sent: Monday, November 06, 2006 2:37 PM
  To: rsync at lists.samba.org
  Subject: rsync not updating files even with checksum flag



  Hello everyone,

  I am having a problem with rsync that I hope someone can help me figure
out.  We are using rsync to sync up files between our staging and production
ftp servers.  Basically internal users are allowed to upload files via a
samba share to a staging server.  Those files are then synced out every 15
minutes via cron to our production ftp servers.

  The problem occurs when a large file is being upload from a windows
machine via the samba share.  If a rsync is instantiated during the time
that the file is being uploaded the destination machines get the file with
the correct filesize and timestamp.  Unfortunately, even though the file
shows the correct size it is not a good copy of the file.  An md5sum of the
files on both the source and destination machine returns different results.
I believe this occurs because windows automatically "reserves" the full size
of the file and fills it out with 0s and then overwrites this as it goes
along copying.  This wouldn't be a big deal except, subsequent runs of rsync
(even with -c) fail to overwrite the file.

  I have tested running an rsync while I was copying the file over to the
source directory locally (not via samba) and the file was corrupted.
However after running an rsync again, the file was updated.  Basically the
problem only occurs when uploading the file via the samba share.

  I know I could use the -I flag to ignore times and filesizes, but from my
understanding this would result in resyncing every file every time, and this
is not what we want.  We are currently using rsync 2.5.5 on the source
machine, and 2.5.7 on the 2 destination machines, but I have also tested
using 2.6.8 on both source and destination with the same results.

  Has anyone else experienced this problem before, or have any ideas for a
fix?  Let me know if I'm not being clear enough, or any other information I
can provide.

  ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
  Mark Osborne
  Web Systems Engineer
  mark.osborne at ni.com
  (512) 683-5019
  ~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~^~
-------------- next part --------------
HTML attachment scrubbed and removed


More information about the rsync mailing list