Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

Lily

Re: A script to automate Synchronization and downloading files/folder from sFTP server to a local server

Hi Martin,
Thank you very much for the response!
I was trying according to the guides you sent me and did the following but not working.
On Windows Task scheduler of 'Action tab' I chose to start a program and execute the WinSCP.exe and on 'Add arguments' section I used the script that I think will be used to save log files, establish connection and synchronize local to remote server as:
/log=c:\path\winscp.log /command "open sftp://xxxx:14001/ -hostkey="ssh-hrsa 2048 ...=" -privatekey="E:\AAA.ppk" -rawsettings ProxyPort=0" "synchronize local|remote|both [ E:\DailyLogs [ cd /BBBB ] ]" "exit"

However this didn't work as I expected and wondering if you can identify for me where my mistake is or any other ideas?

Thanks again,
Lily
martin

Re: A script to automate Synchronization and downloading files/folder from sFTP server to a local server

Start with these links:

You can also have WinSCP GUI generate a download script for you. And then, you just replace get command with synchronize command.
https://winscp.net/eng/docs/guide_automation#generating
Lily

A script to automate Synchronization and downloading files/folder from SFTP server to a local server

Hello, need your help!

I have an SFTP server from the vendor side that they uploading all transaction logs of medical records in a zip folder named as xxxx_yyyymmdd.zip while the date stamp is for current day.

I have installed the WinSCP app and I used to synchronize the files between my local server and remote server then downloading the folders that are not in my local server just manually using the GUI.
But now I want to schedule this process on windows event scheduler and couldn't able to write the WinSCP script for synchronization and downloading the daily uploaded files from the SFTP server to my local server.

I have tried to see if similar posts here but didn't find exactly the way I need, please help!

Thank you in advance,