Re: scp from stdin

2000-11-30 Thread Justin B Rye
Carel Fellinger wrote:
 On Tue, Nov 28, 2000 at 04:10:17PM -0600, Brian McGroarty wrote:
 Is there a way to pipe input to a file on a remote host via scp?
 
 i.e.
 
 tar cz ~user | scp ??? [EMAIL PROTECTED]:outfile.tgz
 
 I think not directly, but you could try:
 
 $ tar cz ~user | ssh [EMAIL PROTECTED] 'umask 077  cat outfile.tgz'
 
 ofcourse umask is futile if the file allready exists:(

Well, try tempfile:

$ tar cz ~user | ssh [EMAIL PROTECTED] \
'umask 077  OUT=$(tempfile -d ~/ -p out -s .tgz)  cat $OUT'
-- 
Justin B Rye - writing from but not for Datacash Ltd



Re: scp from stdin

2000-11-30 Thread Carel Fellinger
On Thu, Nov 30, 2000 at 09:40:37AM +, Justin B Rye wrote:
...
 Well, try tempfile:
 
 $ tar cz ~user | ssh [EMAIL PROTECTED] \
 'umask 077  OUT=$(tempfile -d ~/ -p out -s .tgz)  cat $OUT'

Neat, finally a question simple enough for me to anwser and as a reward I
get to learn some neat thing too! Never used it before, so some reading up
to do (Oh how I love Debina GNU/Linux with all its docs:)...
nice nice seems safe, but...

Bypasses umask alltogether, and assumes TMPDIR is unset,
so nitpickingly we could do with:

$ tar cz ~user | ssh [EMAIL PROTECTED] \
  'unset TMPDIR  cat $(tempfile -d ~/ -p out. -s .tgz)'

-- 
groetjes, carel



scp from stdin

2000-11-28 Thread Brian McGroarty

Is there a way to pipe input to a file on a remote host via scp?

i.e.

tar cz ~user | scp ??? [EMAIL PROTECTED]:outfile.tgz



Re: scp from stdin

2000-11-28 Thread Oliver Elphick
Brian McGroarty wrote:
  
  Is there a way to pipe input to a file on a remote host via scp?
  
  i.e.
  
  tar cz ~user | scp ??? [EMAIL PROTECTED]:outfile.tgz

Not according to its manual page.  Try this:

  tar cz ~user | ssh [EMAIL PROTECTED] cat outfile.tgz

(You put the remote command in quotes so that its redirection doesn't get 
handled
by your local shell.)

-- 
Oliver Elphick[EMAIL PROTECTED]
Isle of Wight  http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47  6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
 
 The earth is the LORD'S, and the fullness thereof; the
  world, and they that dwell therein.   Psalms 24:1




Re: scp from stdin

2000-11-28 Thread Carel Fellinger
On Tue, Nov 28, 2000 at 04:10:17PM -0600, Brian McGroarty wrote:
 
 Is there a way to pipe input to a file on a remote host via scp?
 
 i.e.
 
 tar cz ~user | scp ??? [EMAIL PROTECTED]:outfile.tgz

I think not directly, but you could try:

$ tar cz ~user | ssh [EMAIL PROTECTED] 'umask 077  cat outfile.tgz'

ofcourse umask is futile if the file allready exists:(

-- 
groetjes, carel