-1

i am facing issue while ftp using the command file, but i don't face the executing using the manual execution of commands..

i need to ftp while connecting to ssh machine, the command file is available in the tmp directory.

i did with cd "FtpFolder" with single quotes , without single and double quotes it does not work

but manual commands work any clue..

Command

ssh username@serverip 'cd /tmp; cat cmd_tmp.txt | sftp -oPort=1234 sftpuser@sftpidadress'

Error

Connecting to 111.222.333.1...
sftp> Couldn'sftp> sftp> sftp> sftp> 

command file

cd "FtpFolder"
mget "YYYYMMDD_REPORT - AUTO SAVE _ 1.TXT"
  • 1
    Have you considered using scp instead of sftp? – lcd047 Apr 29 '15 at 7:23
0

Use get command instead of mget. Sftp do not support mget command. And separate commands with newline

cd "FtpFolder" 
get "YYYYMMDD_REPORT - AUTO SAVE _ 1.TXT"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.