Bug 1412 - Bogus warnings with --backup --backup-dir=/path
Summary: Bogus warnings with --backup --backup-dir=/path
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 2.6.2
Hardware: All Linux
: P3 normal (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
Depends on:
Reported: 2004-05-30 00:26 UTC by Wayne Davison
Modified: 2005-03-16 16:48 UTC (History)
0 users

See Also:

Avoid trying to create directories that already exist (1.76 KB, patch)
2004-05-30 00:28 UTC, Wayne Davison
no flags Details
One more patch (755 bytes, patch)
2004-12-23 11:08 UTC, Wayne Davison
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Wayne Davison 2004-05-30 00:26:47 UTC
Report by Stuart Inglis:

When I perform a rsync with backup I get 100's of:

make_bak_dir mkdir "/export/giger.back.....eary/java/weka/gui" failed:
File exists
make_bak_dir mkdir "/export/giger.back....ary/java/weka/gui" failed:
File exists
make_bak_dir mkdir "/export/giger.back...ary/java/weka/gui" failed: File
My backup command is:

rsync -q --backup --backup-dir=/export/giger.backup/share-`date
+%Y-%m-%d` --exclude="/javadocs/" --exclude="/tmp/" --exclude="*.class"
--delete -ar giger::export/share.giger /export

So I wasn't expecting to get lots of output. My cron entry now mails me
errors whenever I backup.
Comment 1 Wayne Davison 2004-05-30 00:28:25 UTC
Created attachment 531 [details]
Avoid trying to create directories that already exist

I found that some of the code paths try to call make_bak_dir() without first
getting an ENOENT error.  This can cause the code to try to create a directory
that already exists.  The attached patch should fix this for you.
Comment 2 Wayne Davison 2004-05-30 01:05:11 UTC
The attached patch has been committed to CVS and will appear in the next release.
Comment 3 Bob Proulx 2004-12-23 09:59:24 UTC
I do not believe this bug is completely fixed in 2.6.3.  I am still seeing many
errors of the type described.  Here is one example:

  rsync: mkdir
failed: File exists (17)

I admit to having a hard time recreating a test case manually.  The problem may
still be one between my chair and keyboard.  I see these errors as the output of
a nightly cron run.  But when I try to recreate the test case using smaller
cases things work as desired.  So I am mostly adding this as an informational
data point to this bug report because I am at wit's end.  It still appears to me
to be a problem with rsync.  But perhaps another set of eyes will see the root
cause of the problem.

I am using Debian woody with rsync-2.6.3-0.backports.org.1 from backports.org on
two of the machines exhibiting this problem.  On another machine with this
problem I am using HP-UX 11.11 with a self compiled version of rsync-2.6.3, but
compiled using the debian patches because I was lazy, so they might still be
coupled.  I will try a pristine source build to confirm or deny it.
Comment 4 Wayne Davison 2004-12-23 11:08:21 UTC
Created attachment 866 [details]
One more patch

You are right that there was another bug that could result in this mkdir
warning message.  It was fixed in CVS on October 27, so this fix did not make
it into 2.6.3.	Sorry for not mentioning this fact as an addendum to this bug
report (before this).  I'm attaching the patch that was checked into CVS.

Prior to this patch, if a directory was being removed, rsync would try to
create a directory in the backup area to note this fact.  This often resulted
in rsync trying to create a directory that already existed.  Fortunately, there
is no real need to backup an empty directory on its own, so the new code only
creates directories in the backup hierarachy when they are needed to hold other
backup items.