rsync fails when syncing empty directories

Max Gilead gilead at yellowhedgehog.com
Tue Sep 28 13:57:06 GMT 2004


I have a script which copies files from remote server to local filesystem
and processes them locally. Files on remote server are cleaned
periodically so that every once in a while the remote directory is empty
just after old files are removed. If I run my script it fails with error
mentioned below. The ugly workaround I use is to 'touch foo' on remote
server so that there's *anything* to make rsync happy.

The rsync behavior in such situation is totally wrong. What's wrong with
trying to sync an empty (existing!) directory? Currently it looks like
it tries to know better what user wants than user himself :/

Here is how it looks like:
rsync -v --recursive --rsh="ssh" login at host:*  dest_dir
receiving file list ... link_stat "/home/login/*" failed: No such file
or directory
done
client: nothing to do: perhaps you need to specify some filenames or the
--recursive option?
rsync error: partial transfer (code 23) at main.c(594)

Such behavior makes rsync usage in a script painful and is obvious bug.
Usually it's considered perfectly fine condition if command has nothing to
do :)

Regards,
Max


More information about the rsync mailing list