Automatic Synchronization to a local Directory from Remote Server

Advertisement

kbhan
Joined:
Posts:
3

Automatic Synchronization to a local Directory from Remote Server

Hello,

I am trying to do an automatic synchronization of a single (.csv) file of around 250mb which updated regularly to a local directory from a remote server but unable to do so.
Running this script but nothing happen. Batch file executed but won't get any update.

Please help.
option batch abort
option confirm off
open sftp://username:pass_word@host_name -hostkey="ssh-dss xxxx xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx"
synchronize local C:\Drive\Local\Reporting /Remote/BDM_Remote
exit
Batch file
winscp.com /script=synctool.txt
I run this bat file and the window closes at: Authenticating with pre-entered password.
Nothing happens.
  • bdmciena@ftp.metricsthatmatter.com.log (5.9 KB, Private file)
Description: Log file

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Automatic Synchronization to a local Directory from Remote Server

Your script does not even log in. The log file says "Password authentication failed". It seems that your credentials are wrong. Do you have any special characters in the password? You may need to URL-encode them: https://winscp.net/eng/docs/session_url#special

Or have WinSCP GUI generate a working script template for you:
https://winscp.net/eng/docs/ui_generateurl#script

Reply with quote

kbhan
Joined:
Posts:
3

Please help: Synchronization automation, Host Key error.

Hello,

Thanks Martin for a solution but now log shows host key doesn't match.
I have chosen the option as attached screenshot to get the script.

open sftp://*******:*************@********* / -hostkey="ssh-dss 1024 oSrasoJwdsRkbYnVIdJWf0pYqNPVOKqiW70AgGZ5fzI="
By using this code, I got the error that host key doesn't match.
I have used below still got the same error.
open sftp://*******:***********@********* -hostkey="ssh-dss 1024 80:91:71:eb:7a:74:bd:7c:60:8b:d0:7b:fe:e1:98:f2"

I have used that one also, got the same error.
open sftp://*******:*************@********* -hostkey="ssh-dss 1024 oSrasoJwdsRkbYnVIdJWf0pYqNPVOKqiW70AgGZ5fzI=ssh-dss 1024 80:91:71:eb:7a:74:bd:7c:60:8b:d0:7b:fe:e1:98:f2"

The key Fingerprints I got while login is... as attached snap also.

ssh-dss 1024 oSrasoJwdsRkbYnVIdJWf0pYqNPVOKqiW70AgGZ5fzI=
ssh-dss 1024 80:91:71:eb:7a:74:bd:7c:60:8b:d0:7b:fe:e1:98:f2

The log for the one of host key type is attached.
Last edited by kbhan on 2021-03-01 07:40; edited 1 time in total
  • Host Key log.txt (5.06 KB, Private file)
Description: Log file
  • Key Page.PNG (24.08 KB, Private file)
  • Capture.PNG (8.38 KB, Private file)
Description: Screenshot

Reply with quote

martin
Site Admin
martin avatar

Re: Please help: Synchronization automation, Host Key error.

Your first two examples are both correct (though the first one is better).
If they do not work for you, post log file for them.

Reply with quote

kbhan
Joined:
Posts:
3

Host Key error...

Hey,

I have tried both the above mentioned syntax but not able to get the result.
Please find the log files and help to resolve the error.
  • Capture.PNG (50.99 KB, Private file)
Description: WinSCP Image
  • Picture1.png (85.62 KB, Private file)
Description: WinSCP Image
  • 3rd March Log.txt (14.33 KB, Private file)
Description: Log File

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Host Key error...

The log file you have posted contains two sessions.
1) GUI session. I'm not sure why you posted that.
2) Scripting session that successfully passed both the host key verification and the authentication. So I believe both your problems are resolved.

You now have a problem with a syntax of your synchronize command, as you are missing quotes. The command should be:
synchronize local "C:\Users\jshridha\OneDrive - ***************\Desktop\New folder" /Clients/BDM_****

Reply with quote

Advertisement

You can post new topics in this forum