I'm trying to update a bunch of downloaded files from a mounted older disk. This command works from the Kterm command line or in a script: rsync -nuv /mnt/kinda2/home/lba/dl/* /home/lba/dl and a list of the files to be updated appears on the screen. But this line (without a tailing * in source) does not work: rsync -nuv /mnt/kinda2/home/lba/dl/ /home/lba/dl and I get the following error message: skipping directory /mnt/kinda2/home/lba/dl/. sent 21 bytes received 20 bytes 82.00 bytes/sec total size is 0 speedup is 0.00 The man pages says that a trailing / on the source will cause rsync to copy the _contents_ of the destination directory. I do that in the second case but it does not work. Without the trailing / on source, rsync would mkdir the target directory and copy the files which is not what I want. I suppose I've misunderstood the man page but could someone set me straight? Larry -- Larry Alkoff N2LA - Austin TX Using Thunderbird on Linux
On 12/6/06, Larry Alkoff <labradley@mindspring.com> wrote:> This command works from the Kterm command line or in a script: > rsync -nuv /mnt/kinda2/home/lba/dl/* /home/lba/dl > and a list of the files to be updated appears on the screen. > > But this line (without a tailing * in source) does not work: > rsync -nuv /mnt/kinda2/home/lba/dl/ /home/lba/dlYou need -r, --recursive to make rsync recurse inside the source directory. The first command worked because the shell expanded /mnt/kinda2/home/lba/dl/* into a list of the individual files inside the source directory before rsync saw it, so rsync didn't need to perform any recursion itself.> The man pages says that a trailing / on the source will cause rsync to > copy the _contents_ of the destination directory. I do that in the > second case but it does not work.That remark in the man page is easy to misinterpret. It was meant to refer only to where the source directory is placed on the destination, not to whether rsync recursively copies its contents. Maybe the man page should say something like this: "A source directory specified without a trailing slash is mapped to a directory of the same name inside the destination directory, but a source directory with a trailing slash is mapped to the destination directory itself." Matt
On Wed, Dec 06, 2006 at 08:06:51PM -0500, Matt McCutchen wrote:> You need -r, --recursive to make rsync recurse inside the source > directory.Alternately, use -d (--dirs), to tell rsync to copy the contents of a "dir/" arg without recursing into the subdirs. It also creates any "dir" args; i.e. no trailing-slash == just create the dir itself. ..wayne..