Root Folder download

Advertisement

lascrams
Joined:
Posts:
1
Location:
Las Vegas

Root Folder download

Hi,

I've been reviewing different topics on your forum, but I'm stuck on something. I'm working on a script (example below) and trying to download files from the root folder of an FTP host.

I have some log files I can share if needed. Right now, I'm just not sure which command I should be using to download from the root folder. I started looking through the documentation, but I couldn't find the answer.
open sftp://SFTPMIT2005-gmail@fn01.test.com/ -hostkey="ssh-rsa 2048 SHA256:fgrhrtytytyu56487" -privatekey="C:\downloads\test\PrivateKey_PuTTy.ppk"
 
 '/' ^
  "ls" ^
  "get *.* C:\downloads\test\clientA\""" ^
 
# Disconnect
close
# Exit WinSCP
exit
I would really appreciate any help with this part. Thank you!

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
42,011
Location:
Prague, Czechia

Re: Root Folder download

Your code is mixing script file syntax and command-line syntax.
Correct script file syntax would be like:
open sftp://SFTPMIT2005-gmail@fn01.test.com/ -hostkey="ssh-rsa 2048 SHA256:fgrhrtytytyu56487" -privatekey="C:\downloads\test\PrivateKey_PuTTy.ppk"
 
get /*.* C:\downloads\test\clientA\
 
exit
See Automate file transfers (or synchronization) to FTP server or SFTP server.

Reply with quote

Advertisement

You can post new topics in this forum