On 08/25/2014 10:54 AM, 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.
Thank you for that last, Jim! Now, what if I want to save BOTH ~anton/MyDocuments and ~anton/MyMusic to the USB stick at /mnt/disks/usb101/ Do I have to issue two commands? If I run rsync ..... ~anton/{MyMusic,MyDocuments} ... that gets expanded by the shell before handing to rsync. The example in the man page rsync -av host:file1 :file2 host:file{3,4} /dest/ raises some questions in my mind about direction and completness of specification. -- /"\ \ / ASCII Ribbon Campaign X Against HTML Mail / \ -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org