title: Copying data from STDOUT to a remote machine using SFTP
body: <p>In order to backup large database partitions to a remote machine using SFTP, I'd like to use the databases dump command and send it directly over using SFTP to a remote location.</p>
  
  <p>This is useful when needing to dump large data sets when you don't have enough local disk space to create the backup file, and then copy it to a remote location.</p>
  
  <p>I've tried using python + <a href="http://www.lag.net/paramiko/" rel="nofollow noreferrer">paramiko</a> which provides this functionality, but the performance much worse than using the native openssh/sftp binary to transfer files.</p>
  
  <p>Does anyone have any idea on how to do this either with the native sftp client on linux, or some library like paramiko? (but one that performs close to the native sftp client)?</p>