On Mon, 11 Feb 2008, Rick Welykochy <[EMAIL PROTECTED]> wrote: > Sridhar Dhanapalan wrote: > > On Sun, 10 Feb 2008, Jamie Wilkinson <[EMAIL PROTECTED]> wrote: > >> This one time, at band camp, Matthew Hannigan wrote: > >>> Note for rsync newbs; > >>> rsync -av /home.orig /home/ > >>> is different from > >>> rsync -av /home.orig/ /home/ > >>> The first will do what you want, the > >>> second will create /home/home.orig/ > >> > >> The other way around; ending with a trailing slash on both directories, > >> as you said the first time, will always make the second directory mirror > >> the first. > > > > My understanding is that the presence of a trailing slash on the target > > directory makes no difference. > > C'mon guys. Idle speculation is no match for the man: > > rsync -avz foo:src/bar /data/tmp > > This would recursively transfer all files from the directory src/bar > on the machine foo into the /data/tmp/bar directory on the local machine. > The files are transferred in "archive" mode, which ensures that sym- > bolic links, devices, attributes, permissions, ownerships, etc. are > preserved in the transfer. Additionally, compression will be used to > reduce the size of data portions of the transfer. > > rsync -avz foo:src/bar/ /data/tmp > > A trailing slash on the source changes this behavior to avoid > creating an additional directory level at the destination. You can think > of a trailing / on a source as meaning "copy the contents of this > directory" as opposed to "copy the directory by name", but in both > cases the attributes of the containing directory are transferred to the > contain- ing directory on the destination. In other words, each of the > follow- ing commands copies the files in the same way, including their > setting of the attributes of /dest/foo: > > rsync -av /src/foo /dest > rsync -av /src/foo/ /dest/foo > > Looks like JW was correct.
I never said otherwise. I referred to the trailing slash on the _target_ (i.e.
the destination), not the source.
--
Geeks aren't interested in politics because government doesn't
double its efficiency and speed once every 18 months.
signature.asc
Description: This is a digitally signed message part.
-- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
