Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

bkand

Can anyone please help me with this code?

Anonymous wrote:

Thanks
so should i replace the my code with
option batch on 

option confirm off
open sftp://<username>:<password>@server -hostkey="ssh-dss xxxxxxxxxxxxxxxx"
cd .
option transfer binary
synchronize local [ <local directory> [ <remote directory> ] ]
 *.txt F:\FTPShare\ftp\
 close
exit
Guest

Thanks
so should i replace the my code with
option batch on 

option confirm off
open sftp://<username>:<password>@server -hostkey="ssh-dss xxxxxxxxxxxxxxxx"
cd .
option transfer binary
synchronize local [ <local directory> [ <remote directory> ] ]
 *.txt F:\FTPShare\ftp\
 close
exit
bkan

How to extract latest files

Good Morning All,
I'm using Winscp client to extract .txt files from a remote server to the local server on my network. I get 3 files each month and they are in the format
MCTF-201306,MCTA-201306,MCTD-20306
MCTF-201307,MCTA-201307,MCD-201307
My code is as below
option batch on

option confirm off
open sftp://<username>:<password>@server -hostkey="ssh-dss xxxxxxxxxxxxxxxx"
cd .
option transfer binary
get -preservetime *.txt F:\FTPShare\ftp\
 close
exit

My code is bringing all the .txt files instead of the latest, can anyone please guide me as to the chnages that i need to make to my code to get only the lates?
Thanks