On Tue, Jan 27, 2015 at 3:50 PM, John Meissen <[email protected]> wrote: > > [email protected] said: >> In other words, each of the following 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 > >> In the first line the contents of /src/foo are copied to /dest. In the >> second line the contents of /src/foo are copied to /dest/foo; you don't want >> that. > > Actually, to be more precise, in the first line the directory 'foo' and its > contents are copied to /dest, while in the second just the contents of 'foo' > (not the directory itself) are copied to /dest/foo.
Because I get it wrong more often than not, I like the -R option, which allows me to be more explicit using a /./: rsync -aRv /src/foo/./ /dest/ # copies files/folders to dest/ rsync -aRv /src/./foo/ /dest/ # same, but will create dest/foo/, if needed rsync -aRv /./src/foo/ /dest/ # same, but will create dest/src/foo/, if needed -R is for relative paths, but I like to think of it standing for "rooted at". Regards, - Robert _______________________________________________ PLUG mailing list [email protected] http://lists.pdxlinux.org/mailman/listinfo/plug
