rsync version: 2.6.8 on both source and destination linux kernel: 2.4.29-3.2a on both command: rsync --whole-file --temp-dir /tmp file.txt destination.machine:/path/to/file/file.txt error: rsync: stat "/path/to/file/file.txt" failed: No such file or directory (2) rsync error: some files could not be transferred (code 23) at main.c(702) rsync is attempting to stat() the transferred file in its final destination, not its temporary destination. This means that if you have any process polling the destination directory, and that process takes (moves/deletes/etc) the transferred file before rsync can stat() it the rsync operation fails. Is there anyway to stop rsync from trying to stat() the file in its destination location? Steps to reproduce: 1.) Set up a tight loop on the destination machine: % while true ; do ; rm /path/to/file/file.txt ; done ; 2.) Get yourself a temp on the source machine % dd if=/dev/zero of=file.txt bs=1024 count=1024 3.) rsync to the file % rsync --whole-file --temp-dir /tmp file.txt destination.machine:/path/to/file/file.txt I've tried this on a bunch of different machines and it seems like multiprocessor machines exhibit this issue, but single processor machines do not. -------------- next part -------------- HTML attachment scrubbed and removed
On Wed, May 17, 2006 at 05:03:15PM -0700, Ferguson, Eric wrote:> rsync --whole-file --temp-dir /tmp file.txt destination.machine:/path/to/file/file.txt > > error: > > rsync: stat "/path/to/file/file.txt" failed: No such file or directory (2) > rsync error: some files could not be transferred (code 23) at main.c(702)This is caused by the use of a temp-dir on a different filesystem than the destination file. In this case, rsync tries to rename the finished file into place, but if it cannot, it copies it into place and then must finish updating the permissions, ownership, etc. after the copy. If the file vanishes during this updating, rsync will complain about it. The easiest fix is to change your temp dir to be on the same filesystem as the destination dir, e.g. --temp-dir=../tmp (create that if it does not yet exist). If you must use a temp-dir on a different drive (typically for I/O reasons, which wouldn't be the case when using --whole-file), there is another way to tell rsync that you want the file to be renamed into its final destination rather than copied into place: if you use a relative partial-dir option, rsync will first copy the file from the temp-dir into the partial-dir, and then rename it into place. For instance: rsync --temp-dir=/tmp --partial-dir=../tmp file.txt dest:/path/ ..wayne..
Maybe Matching Threads
- Referencing variable names rather than column numbers
- Rsync killed my server
- files not moved immediately to final destination from temp location after rsync returns with success
- secure downloads
- [Bug 13222] New: rsync creates warning if time of destination file differs in fractional part of second and owner mismatches