On Wed, Apr 14, 2004 at 07:36:23PM -0400, Edwin Olson wrote: > Suppose you're copying a source file /a/b/c/d/e/f/g/h/myfile and you > want it stored on some other filesystem /backup, but you want the source > path to be truncated so that the file actually ends up as: /backup/h/myfile.
(I'm assuming that you're using the --relative option, or you wouldn't be having this issue.) If you're pushing dirs, do a chdir before calling rsync and then copy a relative path: cd /a/b/c/d/e/f/g rsync -avR h/myfile remote:/backup If you're pushing OR pulling, you can accomplish the same thing using --files-from: echo h/myfile | rsync -av --files-from=- remote:/a/b/c/d/e/f/g /backup With --files-from, the source path specifies the default dir, and the --relative option is on by default, so you'd end up with your desired result. ..wayne.. -- To unsubscribe or change options: http://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html