# scp a file from stdin.

## neuron

is there any way to scp/rsync a piped file?

scp/sftp complains with "skipping non-regular file /dev/stdin", and I can't find any way to do it with rsync either.

----------

## Dieter@be

 *neuron wrote:*   

> and I can't find any way to do it with rsync either.

 

another option would be nfs

it would be something like: blah_blah > /mnt/nfsmount/filename

this not problem solving, only evading though, but it should work  :Smile: 

----------

## neuron

yeah, and ftp works aswell, but it shouldn't be needed!  I'd MUCH prefer to just do this with scp.  Dont know why it cant copy from /dev/stdin like damn near everything else can.

----------

## PowerFactor

Scp is just a wrapper for ssh that emulates the behavior of rcp. If you want to send piped output via ssh then do something like this.

```
$ cat somefile | ssh somehost '> somefile'
```

----------

## neuron

 *PowerFactor wrote:*   

> Scp is just a wrapper for ssh that emulates the behavior of rcp. If you want to send piped output via ssh then do something like this.
> 
> ```
> $ cat somefile | ssh somehost '> somefile'
> ```
> ...

 

I tried that, and it results in an empty file on the remote system.

----------

## catam

$ ssh somehost cat \> somefile <somefile

that should do it

----------

