Topic "Most recent file selection with WinSCP command line"

Author Message
sivaramanm
[View user's profile]

Joined: 2013-11-19
Posts: 5
How do i achieve this using winscp command line automation commands?

https://winscp.net/eng/docs/script_download_most_recent_file
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Your duplicate question on stackoverflow:
http://stackoverflow.com/questions/22388746/winscp-select-most-recent-file

Quote:
You cannot do this on command-line only. If it was possible, the solution in WinSCP documentation would show it instead of the use of wrapper script.

The closest you can get with command-line only is using file mask with time constraint. For example, if you know that one file per day is added only, you can use *>1D mask to select files (one file actually) created within the last 24 hours.
Andreb

Guest


sivaramanm wrote:
How do i achieve this using winscp command line automation commands?

https://winscp.net/eng/docs/script_download_most_recent_file


Hi All... Please please can somebody help me - I'm struggling my ╤╚♦ off Smile
I have files - 6 of them sitting on a remote site, every day a new is placed, I need to download only the newest one, the file name changes every day to I'm aiming at using the "latest date" - needless to say my scripting knowledge is void - I've tied using the >1d - WinSCP does all sorts of weird things and gives me a file called %3C1d - what the hell is that??

my command currently reads "get //ftp05155/FTP*.* <1d"

Please can someby please assist with the correct syntax that would allow me to automate the download of the latest file between 6 others from the SFTP please - connectivity is working, just the download seems to be problematic....

thanks a Huge load for your efforts, much appreciated!
Andre
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25015
Location: Prague, Czechia
Andreb wrote:
my command currently reads "get //ftp05155/FTP*.* <1d"

There should be NO space between *.* and the time constraint + It should be >, not <.
Are you sure the path should start with two slashes?

Btw, it would be nice, if you accept the answer you got on stackoverflow.com.
SLee

Guest


I know its really old post , but I had similar requirement, and what worked for me is : get /out/abc.z*>16h %LOCAL_PATH% where abc.zip was my exact file name in out folder. It got me only abc.zip.
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