samba-bugs@samba.org
2005-Feb-22 18:01 UTC
[Bug 2375] Support (a la Gnu tar) for --directory DIR
https://bugzilla.samba.org/show_bug.cgi?id=2375
wayned@samba.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |ASSIGNED
Summary|Support (a la Gnu tar) for |Support (a la Gnu tar) for -
|'-C' (--directory DIR) |-directory DIR
------- Additional Comments From wayned@samba.org 2005-02-22 10:53 -------
With rsync, you don't need to drop the leading slash like you do with tar,
so
that command doesn't require a separate "cd /", just leave the
slash on the
source. However, there are other directories than "/", and a
--directory option
would allow the sending side to bump the starting dir in a generic way, so I
will accept this as a future-enhancement request (note that -C is already used
by rsync).
One other note: rsync currently allows the setting of the starting dir outside
the relative transfer if you use the --files-from command, if we assume that
your example command had put the "usr" into the "cd /usr"
instead of in the
source path (just to make this a non-root example), this command would do what
you want:
echo local/blackboard | rsync -az --files-from=- /usr rsync://host/dest/
Yeah, that's pretty convoluted, but it works. It's mainly useful for
pulling
files from a remote rsync where it is harder (or impossible) to set the base dir
of the transfer using cd.
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2005-Feb-22 19:01 UTC
[Bug 2375] Support (a la Gnu tar) for --directory DIR
https://bugzilla.samba.org/show_bug.cgi?id=2375 ------- Additional Comments From wayned@samba.org 2005-02-22 11:57 -------> I may be missing something, but are you sure that: > > echo "usr/local/blackboard" | rsync -aRz --files-from=- / > rsync://localhost:1873/backup/client/rsync/ > > would accomplish the same? I tried it, but it does not transfer any (of the > changed) files...Sorry, I forgot to include the -r option (because -r is not implied by -a when --files-from is used). Note also tat the -R option you added is already assumed by --files-from. So replace the "R" with a "r" and it will work. However, as I said in my first reply, you don't need to do any of that for a transfer that is rooted at "/". Just do this: rsync -aRz /usr/local/blackboard rsync://localhost:1873/backup/client/rsync/ Rsync knows how to properly handle a leading slash on the source path. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2005-Feb-22 19:01 UTC
[Bug 2375] Support (a la Gnu tar) for --directory DIR
https://bugzilla.samba.org/show_bug.cgi?id=2375 ------- Additional Comments From e.maryniak@pobox.com 2005-02-22 11:46 ------- I see, but I'm still not sure (may be me). With our current rsync setup, we have in /path/to/destdir (which is what rsync://localhost:1873/backup/client/rsync/ points to) a nice and very handy verbatim copy of the directory structure, like: /path/to/destdir/usr/local/blackboard /path/to/destdir/etc /path/to/destdir/var/spool including, most notably, the same permissions/ownerships of the top level dirs (like /usr and /var) themselves (as compared to the source host). I like this, because it means I can just simple mv such a dir to a thrashed server and worry about perms/ownerships. I may be missing something, but are you sure that: echo "usr/local/blackboard" rsync -aRz --files-from=- / rsync://localhost:1873/backup/client/rsync/ would accomplish the same? I tried it, but it does not transfer any (of the changed) files... Please excuse me if I'm missing some subtle point. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2005-Feb-22 21:22 UTC
[Bug 2375] Support (a la Gnu tar) for --directory DIR
https://bugzilla.samba.org/show_bug.cgi?id=2375 ------- Additional Comments From e.maryniak@pobox.com 2005-02-22 14:10 ------- (In reply to comment #3)> ... > However, as I said in my first reply, you don't need to do any of that for a > transfer that is rooted at "/". Just do this: > > rsync -aRz /usr/local/blackboard rsync://localhost:1873/backup/client/rsync/ > > Rsync knows how to properly handle a leading slash on the source path.Works like a gem, great! Tnx very much --- I guess I was somewhat 'put on the wrong foot' (as we say in Holland) by the examples for -R/--relative in the man page that all use relative paths. As far as I'm concerned this bug may be closed, but of course that's up to you. -- Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the QA contact for the bug, or are watching the QA contact.
samba-bugs@samba.org
2005-Feb-22 22:01 UTC
[Bug 2375] Support (a la Gnu tar) for --directory DIR
https://bugzilla.samba.org/show_bug.cgi?id=2375
wayned@samba.org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |WONTFIX
------- Additional Comments From wayned@samba.org 2005-02-22 14:51 -------
I looked into adding a --directory (-like) option for rsync, and created a patch
named "source-cd.diff" in the "patches" dir with the result.
I don't like this
implementation, though, because it doesn't (and can't) work properly
with
wildcards, so I am not going to add this option.
In the future I may add an option named --omit-path that will cause a path
prefix to be removed from the --relative dirs, but that isn't quite the same
thing as this option so I'll close this.
--
Configure bugmail: https://bugzilla.samba.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug, or are watching the QA contact.