Bug 9670 - support more complex transfers with an absolute partial-dir
Summary: support more complex transfers with an absolute partial-dir
Status: ASSIGNED
Alias: None
Product: rsync
Classification: Unclassified
Component: core (show other bugs)
Version: 3.0.9
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---
Assignee: Wayne Davison
QA Contact: Rsync QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-22 10:17 UTC by Hans Korneder
Modified: 2013-05-27 00:01 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Korneder 2013-02-22 10:17:26 UTC
Hello there,

recently stumbled over a problem syncing subdirectory structures in combination with partial-dir.

Files are saved within partial-dir, but without the subdirectory path they came from, so having the same file names within different subdirectories causes them to be overwritten (and/or lost, of course).

Currently I'm using rsync 3.0.9 protocol version 30 in Linux (openSuSE-12.2).

The setup:

local machine: danae, remote machine: devsys

# cleanup
rm -rf srcdir
ssh korn@devsys "rm -rf /jbod1/tmp/priv-temp-dir /jbod1/tmp/priv-part-dir /jbod1/tmp/destdir"

# create source structure
mkdir -p srcdir/sub1 srcdir/sub2
echo "file1"   > srcdir/sub1/file1
echo "readme1" > srcdir/sub1/README
echo "file2"   > srcdir/sub2/file2
echo "readme2" > srcdir/sub2/README

# rsync
ssh korn@devsys "mkdir -p /jbod1/tmp/priv-temp-dir"
rsync --partial --delay-updates --partial-dir=/jbod1/tmp/priv-part-dir --temp-dir=/jbod1/tmp/priv-temp-dir -a srcdir/ korn@devsys:/jbod1/tmp/destdir

The message:
rsync: rename failed for "/jbod1/tmp/destdir/sub2/README" (from /jbod1/tmp/priv-part-dir/README): No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1052) [sender=3.0.9]


The result:
/jbod1/tmp/destdir/sub2/README is missing
/jbod1/tmp/destdir/sub1/README has the contents of srcdir/sub2/README

Using relative pathnames for the partial-dir does not solve my intentions, as I don't want any partial files in the destination directory structure.

Any help appreciated!

Regards,
Hans
Comment 1 Wayne Davison 2013-05-27 00:01:37 UTC
Rsync only supports such a complex transfer using relative partial-dir values at this time.  I'm changing this to an enhancement request, since the limitations of absolute partial-dirs is fully specified in the man page as how things are currently designed:

"Note also that you should not use an absolute path to bf(--partial-dir) unless (1) there is no chance of any of the files in the transfer having the same name (since all the updated files will be put into a single directory if the path is absolute) and (2) there are no mount points in the hierarchy (since the delayed updates will fail if they can't be renamed into place)."