Topic "[HELP] Need to download from FTP everyday at 4am EST, only the most recent file."

Author Message
songhaegyo

Guest


Hi, I have an FTP that has a new file everyday at 4am EST.

I need to automate this such that it downloads automatically. how do i do this?
Advertisements
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
Sorry, but this is way too vague.
Do you have any specific problem with this task?
songhaegyo

Guest


So this FTP folder has a new batch of files every day, at 4am EST.

What i want to do here is to be able to download it automatically (only the latest file) to my local drive.

How do i write this script?

assume anonymous login
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
You didn't explain much, really.

How do you want to identify the new files? By comparing them against files you already have in a local folder (do you keep them)? Or by timestamp?

Do you really want to download only "latest file" (one) or whole "new batch of files"?

Did you read this?
https://winscp.net/eng/docs/script_download_most_recent_file
songhaegyo

Guest


okay, i am new to this.

new file is defined as something that is not currently stored in the folder. Yes, i do keep the files although i can imagine this isn't the best way as it will get overloaded with time.

how do i get powershell to work with this?
martin◆
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 26890
Location: Prague, Czechia
OK, then it is trivial.
You do not need PowerShell for such an easy task.
Just use WinSCP scripting and use the get -latest command as shown it:
https://winscp.net/eng/docs/script_download_most_recent_file#scripting

Start with:
https://winscp.net/eng/docs/guide_automation
Advertisements

You can post new topics in this forum

Search

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