Topic "Sending only modified files via FTP on port 121"

Author Message
molecule
[View user's profile]

Joined: 2010-06-20
Posts: 3
Location: HKG
Hi all,

I am completely new to this software and scripting so please bear with me.
I would like to create a batch file to launch winscp and send only the most recent modified file in a local directory on our server and send it via FTP to a remote party.
The remote party has indicated that they have opened port 121 for a "more secure" communications channel.
In winscp, I have tried to create a session connecting to the IP on port 121 and selected FTP with SSL/TSL but this always gets rejected with error "error is SSL read server helloA". I believe this means the remote server is disconnecting the session. I am pretty sure that the first time i tried this setting, I actually received a pop up about accepting a certificate. But I know no longer get that message. Does this mean I am connecting incorrectly? Is there a way to delete the certificate and re-test. Previously I believe I was able to connect but was not able to transfer any files and there was a permission error. The only way I can do this is to use the normal FTP on port 21 with no encryption but obviously this is not what I want.

Secondly, since I want this to be automated, I will need to use a batch file with a CLI command for winscp. How do I write a line to only transfer the most recently modified file to the remote party. The folder contains several files but i only want it to transfer the most recently modified one. Can someone please assist?

Lastly, it would be great to receive an email notification once that file is successfully transferred. Is this at all possible from winscp?

Any assistance is GREATLY appreciated.

Thanks all
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
molecule wrote:
Is there a way to delete the certificate and re-test.

You can delete them from registry under HKEY_CURRENT_USER\Software\Martin Prikryl\WinSCP 2.
But I doubt it helps.

Quote:
Secondly, since I want this to be automated, I will need to use a batch file with a CLI command for winscp. How do I write a line to only transfer the most recently modified file to the remote party. The folder contains several files but i only want it to transfer the most recently modified one. Can someone please assist?

Would synchronization be an option?

Quote:
Lastly, it would be great to receive an email notification once that file is successfully transferred. Is this at all possible from winscp?

Please read documentation. If that does not help, come back.
_________________
Martin Prikryl
molecule
[View user's profile]

Joined: 2010-06-20
Posts: 3
Location: HKG
Prikryl, Thanks for your reply.

Quote:
Would synchronization be an option?

I doubt so. We need to transfer files to a third party on a daily basis and the source and destination folders do not contain the same contents. If I read the docs correctly, the synchronisation will do exactly what it is meant to do - synchronise contents of both sides.
molecule
[View user's profile]

Joined: 2010-06-20
Posts: 3
Location: HKG
Hi all,

I managed to get the first bit going. I can now establish a connection to the remote end and put a file on a test folder. Here are my exact commands.

winscp.exe /console /command "option batch on" "open ftp://user:pass@remoteip:port -explicitssl -passive" "put c:\files\Completed /Test" "exit"

Now comes the interesting bit...

Basically, the remote folder will never have the same contents as the local folder and is not managed by me. Thus, they may be removing files from it periodically. This means that I cannot use the "synchronise" option. Can anyone suggest how I may send only the latest or modified file across?
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