Re: scp in reverse?

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Mike Ballon
Date:  
To: Main PLUG discussion list
Subject: Re: scp in reverse?
Yes and no. You can't directly, like this won't work:

tar xvf remotehost:test.tar .

This would, but you're really just copying the file and then
extracting with separate commands

scp remotehost:test.tar . ; tar xvf test.tar

Now you can tunnel with something like sshfs or you can actually pipe
to ssh. For instance I can tar a file up and send it over ssh like so:

tar cvf - 1.jpg | ssh remotehost "cat > 1.jpg.tar"

You could also do that in the opposite direction as well, although to
do this with a "reverse" would take some thinking :)

I suppose something like the following, although I can't test it right now.

ssh remotehost 'tar cvf - 1.jpg | ssh yoursourcehost "cat > 1.jpg.tar"'

maybe use the modifer -t with ssh "ssh -t" so you don't miss any
output. give a try see what happens. half the fun of *nix is figuring
out what works and what doesn't.

On Thu, Mar 15, 2012 at 3:01 PM,
<> wrote:
> Yes, scp (like cp) will copy back or forth, the 2 commands below are legal:
> scp myuser@remotebox:/that/file /this/path
> scp /this/path myuser@remotebox:/that/file
> 1st one will 'retrieve' /that/file from 'remotebox' into /this/path
> 2nd one will copy /this/path to /that/file in 'remotebox'.
> ET
>
> writes:
>>
>>
>> This is interesting.  Does this really mean that
>> scp in reverse is possible by using a similar syntax
>> with the dot at the end to extract a file from a remote
>> computer to my local computer?
>> -----------------
>> Mike Ballon wrote (in part) ... scp in reverse:
>> scp 192.168.0.4:Pictures/2009-Move.from.Florida .
>> I'm guessing the path of the pictures and take note of the dot at the end
>>
>>
>> ---------------------------------------------------
>> PLUG-discuss mailing list -
>> To subscribe, unsubscribe, or to change your mail settings:
>> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
> ---------------------------------------------------
> PLUG-discuss mailing list -
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss