scp write to pipe? - SSH

This is a discussion on scp write to pipe? - SSH ; I have a large gzipped file on a remote system. I want to copy it to the local machine and unzip it on the fly so I write to a pipe and unzip it in background like this. gunzip bigfile ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: scp write to pipe?

  1. scp write to pipe?

    I have a large gzipped file on a remote system. I want to copy it to the
    local machine and unzip it on the fly so I write to a pipe and unzip it
    in background like this.

    gunzip < pipe > bigfile &
    scp remote:bigfile.gz pipe

    Why do I always get an error at the end of the copy that says "pipe:
    truncate: invalid argument" and is there any way to suppress it? The
    file seems to copy and unzip ok.
    --
    To reply by email remove "_nospam"

  2. Re: scp write to pipe?


    "Chuck" wrote in message
    news:G8JGf.4357$Sb.2208@trndny03...
    >I have a large gzipped file on a remote system. I want to copy it to the
    > local machine and unzip it on the fly so I write to a pipe and unzip it
    > in background like this.
    >
    > gunzip < pipe > bigfile &
    > scp remote:bigfile.gz pipe
    >
    > Why do I always get an error at the end of the copy that says "pipe:
    > truncate: invalid argument" and is there any way to suppress it? The
    > file seems to copy and unzip ok.


    Not sure, except that gunzip used to handle raw stdout output should use
    "gunzip -c". Why not avoid the pipe whackiness and do this?

    ssh remote "cat bigfile.gz" | gunzip -c > bigfile




  3. Re: scp write to pipe?

    Nico Kadel-Garcia wrote:
    > "Chuck" wrote in message
    > news:G8JGf.4357$Sb.2208@trndny03...
    >> I have a large gzipped file on a remote system. I want to copy it to the
    >> local machine and unzip it on the fly so I write to a pipe and unzip it
    >> in background like this.
    >>
    >> gunzip < pipe > bigfile &
    >> scp remote:bigfile.gz pipe
    >>
    >> Why do I always get an error at the end of the copy that says "pipe:
    >> truncate: invalid argument" and is there any way to suppress it? The
    >> file seems to copy and unzip ok.

    >
    > Not sure, except that gunzip used to handle raw stdout output should use
    > "gunzip -c". Why not avoid the pipe whackiness and do this?
    >
    > ssh remote "cat bigfile.gz" | gunzip -c > bigfile
    >
    >
    >


    Duh!

    --
    To reply by email remove "_nospam"

+ Reply to Thread