![](https://seccdn.libravatar.org/avatar/27aacf61a13c66fcc083fcf8a84823bc.jpg?s=120&d=mm&r=g)
Per Jessen wrote:
Randall R Schulz wrote:
The subject pretty much says it. I'd like to run rsync and get the effect that the --parents option has with cp. Specifically, that means that all leading directory components in the source arguments are replicated beneath the destination directory.
I think the '--relative' option does that.
rsync -avR /home/per/Documents <somedir>
produces
<somedir>/home/per/Documents
/Per
In addition to relative, if you use the --files-from option, then the entire directory path is preserved and recreated on the destination machine. It doesn't matter how you create the file to take the actual files-from, but remember if you want recursive behavior on directories specified in the --files-from file, you must explicitly specify the -r option. Using --files-from is the only case where the -a option doesn't imply the -r option. An example of using --files-from would be: find /var/cache/zypp/packages -type f > rsynctmpfile rsync -uavr --files-from=rsynctmpfile / randall@destmachine.com:/ You can also tell it to create the exact dir structure below some other destination directory 'somedir' with: rsync -uavr --files-from=rsynctmpfile / randall@destmachine.com:/somedir I ran into this issue with the scripts for my local update repository, and I dang near *couldn't* keep rsync from copying /all/the/directory/info/before/file -- David C. Rankin, J.D.,P.E. Rankin Law Firm, PLLC 510 Ochiltree Street Nacogdoches, Texas 75961 Telephone: (936) 715-9333 Facsimile: (936) 715-9339 www.rankinlawfirm.com -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org For additional commands, e-mail: opensuse+help@opensuse.org