Anton Aylward wrote:
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?
rsync --options ~anton/MyDocuments ~anton/MyMusic /mnt/disks/usb101/ -- Per Jessen, Zürich (12.9°C) http://www.dns24.ch/ - your free DNS host, made in Switzerland. -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org