Bug 2831 - rsync tries to create "." directory
Summary: rsync tries to create "." directory
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.5
Hardware: x86 Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2005-06-28 03:17 UTC by mario
Modified: 2006-03-12 02:56 UTC (History)
0 users

See Also:

Ignore EEXIST on second mkdir() call (537 bytes, patch)
2005-06-30 10:00 UTC, Wayne Davison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description mario 2005-06-28 03:17:31 UTC
/usr/bin/rsync -avx --delete --numeric-ids --relative --delete-excluded \
    --exclude=/www/*/bin/ --exclude=/www/*/dev/ --exclude=/www/*/etc/ \
    --exclude=/www/*/lib/ --exclude=/www/*/usr/ --link-dest=/backup/daily.1/ \
    /etc/ /backup/daily.0/
building file list ... done
rsync: recv_generator: mkdir "/backup/daily.0/etc/." failed: File exists (17)
/etc/localtime -> /usr/share/zoneinfo/Europe/Berlin
rsync error: some files could not be transferred (code 23) at main.c(791)
Comment 1 Wayne Davison 2005-06-30 10:00:25 UTC
Created attachment 1292 [details]
Ignore EEXIST on second mkdir() call
Comment 2 Wayne Davison 2005-06-30 10:01:18 UTC
Please double-check the rsync version on both ends of the transfer.  I can
duplicate the bug with the args you mention back in 2.5.7 and 2.6.0, but not in
2.6.1 or newer -- at least, not without adding either --no-implied-dirs or
--exclude='*/'.  The difference is that newer rsyncs prefer to use the path
/etc/ rather than /etc/./, , and it is the trailing . dir that tickles the bug
(due to create_directory_path() creating the actual directory itself instead of
just the path through the parent directory).

In any case, the just-attached patch fixes the problem in the CVS version.
Comment 3 Wayne Davison 2005-06-30 10:12:11 UTC
I should also mention that you can avoid the bug by simply never using a
trailing slash on a source path when using --relative (there's no difference in
behavior with or without a trailing slash when --relative is used).

Also, your --excludes won't exclude anything because they are anchored at /www
and the transfer is starting at /etc (due to the --relative option).
Comment 4 mario 2005-06-30 10:32:01 UTC
I use rsnapshot as a backup tool to backup some files on a different location on
the same partition. I backup 3 folders, but the exclude-directory defined in
rsnapshot get forwared to every rsync call. That's why they are listed there.

And to your other question, cause of a local backup, the rsync version should
not differ :)

I already had the same problem on another computer, but upgrading from 2.6.0 to
2.6.5 fixed it. This time it did not help though.

Just tried out the remove slash in the source path.. that works, yes! :)
I tried several different arguments, but never tried without the slash

Thank you :)