Topic "Help with command line synchronize"

Author Message
Guest




I am able to sync a remote folder using the GUI, but only if I choose "preview changes' and 'check all' option.

Ultimately, I want to schedule sync to run automatically, so I went into command shell mode with the following syntax. The script seems to run and exit, but no files are synced. Any tips?

From command line
Code:

"C:\Program Files (x86)\WinSCP\WinSCP.exe" /console /script=c:\backup\backupScript.txt /log=c:\backup\%date:~10,4%%date:~4,2%%date:~7,2%_BackupLog.txt


Contents of backupScript
Code:

open username:password@ipaddress
synchronize remote C:\backup /home/username/backup
close
Guest




Below are the contents for the log file

Quote:
. 2010-09-08 14:24:02.287 --------------------------------------------------------------------------
. 2010-09-08 14:24:02.288 WinSCP Version 4.2.8 (Build 818) (OS 6.1.7600)
. 2010-09-08 14:24:02.288 Login time: Wednesday, September 08, 2010 2:24:02 PM
. 2010-09-08 14:24:02.288 --------------------------------------------------------------------------
. 2010-09-08 14:24:02.288 Session name: username@ipaddress
. 2010-09-08 14:24:02.288 Host name: ipaddress (Port: 22)
. 2010-09-08 14:24:02.288 User name: username (Password: Yes, Key file: No)
. 2010-09-08 14:24:02.288 Tunnel: No
. 2010-09-08 14:24:02.288 Transfer Protocol: SFTP (SCP)
. 2010-09-08 14:24:02.288 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2010-09-08 14:24:02.288 Proxy: none
. 2010-09-08 14:24:02.288 SSH protocol version: 2; Compression: No
. 2010-09-08 14:24:02.288 Bypass authentication: No
. 2010-09-08 14:24:02.288 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2010-09-08 14:24:02.288 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2010-09-08 14:24:02.289 SSH Bugs: -,-,-,-,-,-,-,-,-
. 2010-09-08 14:24:02.289 SFTP Bugs: -,-
. 2010-09-08 14:24:02.289 Return code variable: Autodetect; Lookup user groups: Yes
. 2010-09-08 14:24:02.289 Shell: default
. 2010-09-08 14:24:02.289 EOL: 0, UTF: 2
. 2010-09-08 14:24:02.289 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2010-09-08 14:24:02.289 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2010-09-08 14:24:02.289 Local directory: default, Remote directory: home, Update: No, Cache: Yes
. 2010-09-08 14:24:02.289 Cache directory changes: Yes, Permanent: Yes
. 2010-09-08 14:24:02.289 DST mode: 1
. 2010-09-08 14:24:02.289 --------------------------------------------------------------------------
. 2010-09-08 14:24:02.289 Looking up host "ipaddress"
. 2010-09-08 14:24:02.289 Connecting to ipaddress port 22
. 2010-09-08 14:24:02.335 Server version: SSH-2.0-OpenSSH_4.7p1 Debian-8ubuntu1.2
. 2010-09-08 14:24:02.335 We believe remote version has SSH-2 ignore bug
. 2010-09-08 14:24:02.335 Using SSH protocol version 2
. 2010-09-08 14:24:02.335 We claim version: SSH-2.0-WinSCP_release_4.2.8
. 2010-09-08 14:24:02.342 Doing Diffie-Hellman group exchange
. 2010-09-08 14:24:02.390 Doing Diffie-Hellman key exchange with hash SHA-1
. 2010-09-08 14:24:02.605 Host key fingerprint is:
. 2010-09-08 14:24:02.605 ssh-rsa 2048 e5:c0:21:b3:f4:1f:7e:6b:8f:d4:a3:df:74:8d:a5:04
. 2010-09-08 14:24:02.605 Initialised AES-256 SDCTR client->server encryption
. 2010-09-08 14:24:02.605 Initialised HMAC-SHA1 client->server MAC algorithm
. 2010-09-08 14:24:02.605 Initialised AES-256 SDCTR server->client encryption
. 2010-09-08 14:24:02.605 Initialised HMAC-SHA1 server->client MAC algorithm
! 2010-09-08 14:24:02.613 Using username "username".
. 2010-09-08 14:24:02.626 Prompt (6, SSH password, , &Password: )
. 2010-09-08 14:24:02.626 Using stored password.
. 2010-09-08 14:24:02.626 Sent password
. 2010-09-08 14:24:02.635 Access granted
. 2010-09-08 14:24:02.642 Opened channel for session
. 2010-09-08 14:24:02.725 Started a shell/command
. 2010-09-08 14:24:02.725 --------------------------------------------------------------------------
. 2010-09-08 14:24:02.725 Using SFTP protocol.
. 2010-09-08 14:24:02.725 Doing startup conversation with host.
> 2010-09-08 14:24:02.725 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2010-09-08 14:24:02.730 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2010-09-08 14:24:02.730 SFTP version 3 negotiated.
. 2010-09-08 14:24:02.730 We believe the server has signed timestamps bug
. 2010-09-08 14:24:02.730 We will use UTF-8 strings for status messages only
. 2010-09-08 14:24:02.730 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2010-09-08 14:24:02.730 Getting current directory name.
. 2010-09-08 14:24:02.730 Getting real path for '.'
> 2010-09-08 14:24:02.730 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2010-09-08 14:24:02.734 Type: SSH_FXP_NAME, Size: 51, Number: 16
. 2010-09-08 14:24:02.734 Real path is '/home/username'
. 2010-09-08 14:24:02.735 Startup conversation with host finished.
< 2010-09-08 14:24:02.735 Script: Active session: [1] username@ipaddress
> 2010-09-08 14:24:02.735 Script: synchronize remote C:\backup /home/username/backup
< 2010-09-08 14:24:02.735 Script: Comparing...
. 2010-09-08 14:24:02.735 Collecting synchronization list for local directory 'C:\backup' and remote directory '/home/username/backup', mode = 0, params = 1030
. 2010-09-08 14:24:02.736 Listing directory "/home/username/backup".
> 2010-09-08 14:24:02.736 Type: SSH_FXP_OPENDIR, Size: 31, Number: 267
< 2010-09-08 14:24:02.744 Type: SSH_FXP_HANDLE, Size: 13, Number: 267
> 2010-09-08 14:24:02.744 Type: SSH_FXP_READDIR, Size: 13, Number: 524
< 2010-09-08 14:24:02.749 Type: SSH_FXP_NAME, Size: 211, Number: 524
> 2010-09-08 14:24:02.749 Type: SSH_FXP_READDIR, Size: 13, Number: 780
< 2010-09-08 14:24:02.753 Type: SSH_FXP_STATUS, Size: 28, Number: 780
< 2010-09-08 14:24:02.753 Status code: 1
> 2010-09-08 14:24:02.753 Type: SSH_FXP_CLOSE, Size: 13, Number: 1028
< 2010-09-08 14:24:02.754 Script: Synchronizing...
. 2010-09-08 14:24:02.754 Synchronizing local directory 'C:\backup\' with remote directory '/home/username/backup/', params = 1030
> 2010-09-08 14:24:06.459 Script: exit
. 2010-09-08 14:24:06.459 Closing connection.
. 2010-09-08 14:24:06.459 Sending special code: 12
. 2010-09-08 14:24:06.459 Sent EOF message
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
Please read FAQ. if that does not help come back.
https://winscp.net/eng/docs/faq_synchronize
_________________
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