Hans Deragon
2005-Feb-25 23:14 UTC
Feature request: Being able specify that the destination should follow source directory structure.
Greetings. If I do this: rsync --hard-links one.server.com::"module/somedir/images/redhat/3.0WS/en/os/i386 module/someotherdir/1.0/images/redhat/3.0WS/en/os/i386" /export/distros I get: /export/distros/i386/... and a conflict between the two sources. I want for destination: /export/distros/images/redhat/3.0WS/en/os/i386 /export/distros/1.0/images/redhat/3.0WS/en/os/i386 In other words, I would like to see an option that says to rsync to create some of the subdirectories found in the source directory. Something like: rsync --hard-links one.server.com::"distros/somedir/'images/redhat/3.0WS/en/os/i386' distros/someotherdir/'1.0/images/redhat/3.0WS/en/os/i386'" /export/distros Notice the ' which would be an indicator for the list of subdirectories to recreate on the destination. ' is a valid character for filename, so something else could be used, but I have put it there as an example. Because I want to maintain the hard links, I do not want to run two separate rsync commands to perform this copying. Best regards, Hans Deragon -- Consultant en informatique/Software Consultant Deragon Informatique inc. Open source: http://www.deragon.biz http://facil.qc.ca (Promotion du libre) mailto://hans@deragon.biz http://autopoweroff.deragon.biz (Logiciel)
Wayne Davison
2005-Feb-25 23:49 UTC
Feature request: Being able specify that the destination should follow source directory structure.
On Fri, Feb 25, 2005 at 06:13:53PM -0500, Hans Deragon wrote:> Because I want to maintain the hard links, I do not want to run two > separate rsync commands to perform this copying.You might be able to use two separate runs and --link-dest to get what you want: COMMON=images/redhat/3.0WS/en/os/i386 SRC1=somedir/$COMMON SRC2=someotherdir/1.0/$COMMON DEST1=/export/distros/$COMMON DEST2=/export/distros/1.0/$COMMON rsync -avH --link-dest=$DEST2 one.server.com::distros/$SRC1/ $DEST1 rsync -avH --link-dest=$DEST1 one.server.com::distros/$SRC2/ $DEST2 This presumes that identical files are in identical dirs. If not, you can use -R combined with some symlinks and --no-implied-dirs to make the original command work like you want: cd /export mkdir -p links/somedir links/someotherdir mkdir -p distros/images distros/1.0 ln -s ../../distros/images links/somedir/images ln -s ../../distros/1.0 links/someotherdir/1.0 rsync -avHR --no-implied-dirs one.server.com::"distros/somedir/images/redhat/3.0WS/en/os/i386 distros/someotherdir/1.0/images/redhat/3.0WS/en/os/i386" /export/links ..wayne..
Apparently Analagous Threads
- Feature Request: Options to limit --one-file-system at the source or destination.
- rsync server complaining about vanishing files while they are not.
- overlaid filled contour plots
- [Fwd: Re: rsync server complaining about vanishing files while they are not.]
- file.copy