On Mon, 25 Aug 2014 07:54:29 -0700 Jim Cunning wrote:
On 08/25/2014 07:38 AM, Per Jessen wrote:
I'm trying to copy
rsync -av server:"/dir/jessen/.* /dir/jessen/*" /home/somedir
The idea being everything under /dir/jessen/ should end up under /home/somedir. This works fine except rsync also picks up '..' and traverses up the directory tree, which I certainly don't want.
I've tried a few variations with --exclude and --exclude-from, but nothing has worked. Any hints?
You should omit the ".*" and "*" from your command line:
rsync -av server:/dir/jessen/ /home/somedir
will copy the entire contents of /dir/jessen, including hidden files, to /home/somedir. Be sure to include the trailing / on the source directory argument--otherwise you will get the source directory, too, copying the entire directory tree /dir/jessen to /home/dir/jessen.
I usually use the command line options "-vasP" to copy files with spaces in their names and also get a progress indicator.
'rsync -avAX sourcedir/ targetdir' makes a true mirror of the source directory under 'targetdir/' assuming there are no hard links. I use this all the time to make and restore snapshots of live installations and user space contents ... works great. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org