Topic "How to extract latest files"

Author Message
bkan

Guest


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
Code:

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
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24512
Location: Prague, Czechia
Would this FAQ help?
http://winscp.net/eng/docs/faq_script_modified_files
_________________
Martin Prikryl
Guest




Thanks
so should i replace the my code with
Code:

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
bkand

Guest


Can anyone please help me with this code?
Anonymous wrote:
Thanks
so should i replace the my code with
Code:

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
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License