rsync fails if it cannot stat destination file

Ferguson, Eric ericferg at amazon.com
Thu May 18 00:03:15 GMT 2006


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


More information about the rsync mailing list