how to pipe data to sftp connection?

Posted by JMW on Server Fault See other posts from Server Fault or by JMW
Published on 2012-06-19T16:03:04Z Indexed on 2012/07/05 15:18 UTC
Read the original article Hit count: 385

Filed under:
|
|

ftp supports the put "|..." "remote-file.name" command to pipe data to an ftp connection. Is there something similar available for sftp?

In sftp i get the following error:

sftp 'jmw@backupsrv:/uploads'
sftp> put "| tar -cx /storage" "backup-2012-06-19--17-51.tgz"
stat | tar -cv /storage: No such file or directory

as above the sftp client doesn't obviously execute the command.

i want to use the pipe command to directly redirect the file stream to sftp. (because there is not enough space left to create a backup file on the same disk before uploading it to sftp server.)

© Server Fault or respective owner

Related posts about ssh

Related posts about sftp