Topic "Shortcut to synchronize..... exemple doesnt work for me"

Author Message
A-son

Guest


Hi, i just how found this great app, and going to try it out,

I have tryied this exemple
https://winscp.net/eng/docs/script_synchronize_any_local_file

And i have made like this:

sendto.bat
Code:

winscp.com /script=sendto.txt /parameter %1 "/c/home/ason/test/%~n1%~x1" /log=log.txt


sendto.txt
Code:

# Being intended for interactive session, we are not enabling batch mode
# Connect
open NAS_Ason
# Synchronize paths provided via environment variables
synchronize remote %1% %2%


log.txt
Code:
. 2011-08-13 23:47:20.690 --------------------------------------------------------------------------
. 2011-08-13 23:47:20.691 WinSCP Version 4.3.0 (Byggd 1029) (OS 6.0.6002 Service Pack 2)
. 2011-08-13 23:47:20.691 Login time: den 13 augusti 2011 23:47:20
. 2011-08-13 23:47:20.691 --------------------------------------------------------------------------
. 2011-08-13 23:47:20.691 Session name: NAS_Ason
. 2011-08-13 23:47:20.692 Host name: x.dyndns-server.com (Port: 9022)
. 2011-08-13 23:47:20.692 User name: ason (Password: Yes, Key file: No)
. 2011-08-13 23:47:20.693 Tunnel: No
. 2011-08-13 23:47:20.693 Transfer Protocol: SFTP (SCP)
. 2011-08-13 23:47:20.693 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2011-08-13 23:47:20.693 Proxy: none
. 2011-08-13 23:47:20.693 SSH protocol version: 2; Compression: No
. 2011-08-13 23:47:20.694 Bypass authentication: No
. 2011-08-13 23:47:20.694 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2011-08-13 23:47:20.694 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2011-08-13 23:47:20.694 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2011-08-13 23:47:20.694 SFTP Bugs: -,-
. 2011-08-13 23:47:20.694 Return code variable: Autodetect; Lookup user groups: Yes
. 2011-08-13 23:47:20.694 Shell: default
. 2011-08-13 23:47:20.694 EOL: 0, UTF: 2
. 2011-08-13 23:47:20.694 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2011-08-13 23:47:20.694 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2011-08-13 23:47:20.694 Local directory: default, Remote directory: home, Update: Yes, Cache: Yes
. 2011-08-13 23:47:20.694 Cache directory changes: Yes, Permanent: Yes
. 2011-08-13 23:47:20.694 DST mode: 1
. 2011-08-13 23:47:20.695 --------------------------------------------------------------------------
. 2011-08-13 23:47:20.695 Looking up host "x.dyndns-server.com"
. 2011-08-13 23:47:20.750 Connecting to 83.216.0.0 port 9022
. 2011-08-13 23:47:21.012 Server version: SSH-2.0-OpenSSH_4.3p2 Debian-5~bpo.1.netgear1
. 2011-08-13 23:47:21.012 We believe remote version has SSH-2 ignore bug
. 2011-08-13 23:47:21.012 Using SSH protocol version 2
. 2011-08-13 23:47:21.012 We claim version: SSH-2.0-WinSCP_release_4.3
. 2011-08-13 23:47:21.029 Doing Diffie-Hellman group exchange
. 2011-08-13 23:47:21.107 Doing Diffie-Hellman key exchange with hash SHA-1
. 2011-08-13 23:47:27.015 Host key fingerprint is:
. 2011-08-13 23:47:27.015 ssh-rsa 2048 ac:87:5d:a7:fa:ce:fa:04:88:9d:5a:31:69:9d:03:87
. 2011-08-13 23:47:27.016 Initialised AES-256 SDCTR client->server encryption
. 2011-08-13 23:47:27.016 Initialised HMAC-SHA1 client->server MAC algorithm
. 2011-08-13 23:47:27.016 Initialised AES-256 SDCTR server->client encryption
. 2011-08-13 23:47:27.016 Initialised HMAC-SHA1 server->client MAC algorithm
! 2011-08-13 23:47:27.018 Using username "ason".
. 2011-08-13 23:47:27.099 Prompt (6, SSH password, , &Lsenord:)
. 2011-08-13 23:47:27.099 Using stored password.
. 2011-08-13 23:47:27.100 Sent password
. 2011-08-13 23:47:27.123 Access granted
. 2011-08-13 23:47:27.180 Opened channel for session
. 2011-08-13 23:47:27.199 Started a shell/command
. 2011-08-13 23:47:27.200 --------------------------------------------------------------------------
. 2011-08-13 23:47:27.200 Using SFTP protocol.
. 2011-08-13 23:47:27.200 Doing startup conversation with host.
> 2011-08-13 23:47:27.200 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2011-08-13 23:47:27.346 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2011-08-13 23:47:27.346 SFTP version 3 negotiated.
. 2011-08-13 23:47:27.346 We believe the server has signed timestamps bug
. 2011-08-13 23:47:27.346 We will use UTF-8 strings for status messages only
. 2011-08-13 23:47:27.346 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2011-08-13 23:47:27.346 Getting current directory name.
. 2011-08-13 23:47:27.347 Getting real path for '.'
> 2011-08-13 23:47:27.347 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2011-08-13 23:47:27.350 Type: SSH_FXP_NAME, Size: 45, Number: 16
. 2011-08-13 23:47:27.350 Real path is '/c/home/ason'
. 2011-08-13 23:47:27.350 Startup conversation with host finished.
< 2011-08-13 23:47:27.351 Script: Aktiv session: [1] NAS_Ason
> 2011-08-13 23:47:27.352 Script: synchronize remote C:\Program Files\WinSCP\WinSCP.sv /c/home/ason/test/WinSCP.sv
. 2011-08-13 23:47:27.353 Script: Failed


And in command window i get:
Too many parameters for the command 'synchronize'.

What did i do wrong?

Thanks, Ason
Advertisements
A-son

Guest


I upgrade to:
WinSCP Version 4.3.4 (Build 1428) (OS 6.0.6002 Service Pack 2)
And no luck Sad
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please try
synchronize remote "%1%" "%2%"
_________________
Martin Prikryl
Guest




Thanks for your reply

Now i get this in the command window:

Code:

C:\Program Files\WinSCP>winscp.com /script=sendto.txt /parameter "C:\Program Fil
es\WinSCP\log.txt" "/c/home/ason/test/log.txt" /log=log.txt
Searching for host...
Connecting to host...
Authenticating...
Using username "ason".
Authenticating with pre-entered password.
Authenticated.
Starting the session...
Reading remote directory...
Session started.
Active session: [1] NAS_Ason
Comparing...
Local 'C:\Program Files\WinSCP\log.txt' => Remote '/c/home/ason/test/log.txt'
Nothing to synchronize.
winscp>


And i have upload log.txt with ftp client first,
and i made a change in local file
and same resultat.
whats wrong now?
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
You cannot synchronize files. Only whole directories.
_________________
Martin Prikryl
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