Re: cygwin scp -r fails



On 2006-02-15, gregt@xxxxxxx <gregt@xxxxxxx> wrote:
I just installed the latest cygwin on my winXP laptop, and I am having
an issue using scp -r. I have tried it to multiple Linux and Solaris
boxes, so I am quite sure it's not on the receiving server side.
I am not sure if this is a bug or my problem; here's what I do:
scp -rv 2006* user@unix:.

Normally this would (and did on the older version) copy all of my 2006*
folders into the home directory of the "user" on the box "unix" - what
it does now, it creates empty folders.
When the command is ran with multiple v for verbosity (and I am using
folder windows for testing here) it still does not work, and here's the
debug info.

Has anyone seen it? Any ideas? I have found 2 similar postings on the
web, but no resolutions so far.

You're running it from the Cygwin shell or a Windows command prompt?
I suspect the latter.

On Unix, the shell expands wildcards but on Windows it's left up to
individual apps.

Up until 4.3p1, scp invoked ssh via the system(), which has the side
effect of expanding wildcards (since it uses the shell). 4.3p1 and
newer don't use system(), instead they construct an arglist and invoke
execl directly.

So, given a directory containing the files "foo" and "bar", on Unix
the command "scp * host:" will be expanded to "scp foo bar host:", scp
will open "foo" and "bar" in turn and send them to "host". On the
Windows CLI, the "*" won't be expanded and scp will try to open a
file literally called "*" which doesn't exist.

A workaround is to have the Cygwin shell expand the wildcards, eg:
c:\> sh -c "scp -r 2006* server:"

--
Darren Tucker (dtucker at zip.com.au)
GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69
Good judgement comes with experience. Unfortunately, the experience
usually comes from bad judgement.
.



Relevant Pages

  • Re: Comfortable ssh file management tool for linux ?
    ... I think of a scenario with vmware on my windows machine, ... You use scp to transfer data ... > scp and ssh do not require passwords.) ... > Manipulating data like this via a Windows client may not be as easy. ...
    (comp.os.linux.x)
  • Re: Comfortable ssh file management tool for linux ?
    ... > tool from a win-machine to a linux server and UNPACK IT ON THE SERVER ... You use scp to transfer data ... Manipulating data like this via a Windows client may not be as easy. ...
    (comp.os.linux.x)
  • Re: SCP!
    ... > "pull" the data because putty signs me into the freebsd system. ... > I were to use SCP I would be pulling to the freebsd system becuase I ... > So how do I sign on to freebsd and then scp the folder to the windows ...
    (freebsd-questions)
  • Re: severely OT; re PUTTY [ssh]
    ... I've seen some limitations with scp of putty. ... I suggest Samba in place of scp. ... or a last resort for dealing with Unix Windows ...
    (freebsd-questions)