I have some files in a directory on HDFS and I need to move them via SFTP to a remote server. Normally, what I do is that I download the files from the HDFS to a unix folder with
hdfs dfs -get /hdfs_path/folder/file.txt /unix_path/dest/path
and then i move it with sftp as:
echo "put /unix_path/dest/path/file.txt /remote_folder" | sftp -b - "user@$remoteServer"
What I want to know: is there any way to do the direct sending of the file via sftp to the remote server from hadoop without needing to do the previous hdfs dfs -get?