Topic "Anonymous FTP synchronize"

Author Message
jmjones8
[View user's profile]

Joined: 2014-03-05
Posts: 5
Location: Fairbanks
Hello,

I am trying to automate the synchronization of a remote file to a local file, and the remote file is on an ftp that I anonymously log into. I am trying the following script

option confirm off
option batch abort
open ftp://anonymous@ftpsite.edu
synchronize local "C:\\localfile\\" /remote/file/names
exit

And it is not working. This is similar to something I use for sftp file transfers, which works fine. I can't find examples using an anonymous ftp, so I thought I'd ask here. Thanks.
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
The arguments of synchronize are paths to directory, not file.

You cannot synchronize files directly this way.

You can use a filemask to restrict directory synchronization to a single file.

But it's an overkill, why don't you just use get -neweronly?

get -neweronly /remote/path/filename.txt C:\localpath\

https://winscp.net/eng/docs/scriptcommand_get
jmjones8
[View user's profile]

Joined: 2014-03-05
Posts: 5
Location: Fairbanks
Hi Prikyl,

My apologies for not being too clear. I am not trying to get the newest files, I am trying to get about 300 files (about half the files in the folder) that are an archived data set that I want to download and process. I have used file masks to get similar files through an sftp. I edited the arguments for synchronize to only be the one of the directories with the files I am after, but no luck.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
So how do you identify those 300?
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