Mark Osborne wrote: > > 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. >
You could do what we do. We use "smbstatus" first to check that there are no SMB locks present (on files only - you can ignore the ones on dirs), then rename the new files out to a staging dir - then rsync that instead. It guarantees the files have been finished, and even lets the Windows users know the files have been picked up (as they disappear) -- Cheers Jason Haar Information Security Manager, Trimble Navigation Ltd. Phone: +64 3 9635 377 Fax: +64 3 9635 417 PGP Fingerprint: 7A2E 0407 C9A6 CAF6 2B9F 8422 C063 5EBB FE1D 66D1 -- To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html