Topic "Result code 1 after synchronize without doing anything"

Author Message
rgbgerman
[View user's profile]

Joined: 2008-06-10
Posts: 7
Location: Germany
hi there,

i use 4.1.3 build 393.

i made a script, for sync local and remote.
when both parties are equal, the winscp return with error code 1.
the logfile says in the last lines:


Code:

> 2008-06-10 16:55:48.683 Type: SSH_FXP_OPENDIR, Size: 41, Number: 7435
< 2008-06-10 16:55:48.699 Type: SSH_FXP_STATUS, Size: 24, Number: 7172
. 2008-06-10 16:55:48.699 Discarding reserved response
< 2008-06-10 16:55:48.730 Type: SSH_FXP_HANDLE, Size: 13, Number: 7435
> 2008-06-10 16:55:48.730 Type: SSH_FXP_READDIR, Size: 13, Number: 7692
< 2008-06-10 16:55:48.746 Type: SSH_FXP_NAME, Size: 853, Number: 7692
> 2008-06-10 16:55:48.746 Type: SSH_FXP_READDIR, Size: 13, Number: 7948
< 2008-06-10 16:55:48.777 Type: SSH_FXP_STATUS, Size: 28, Number: 7948
< 2008-06-10 16:55:48.777 Status/error code: 1
> 2008-06-10 16:55:48.777 Type: SSH_FXP_CLOSE, Size: 13, Number: 8196
. 2008-06-10 16:55:48.777 Closing connection.


1) i cannot see why error code 1
2) shouldnt it be error code 0, because there is nothing to do ???

any idea ????
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Do you mean the exit code of winscp process is 1, or do you just refer to the code in the log?
_________________
Martin Prikryl
rgbgerman
[View user's profile]

Joined: 2008-06-10
Posts: 7
Location: Germany
hi,

the exit code of winscp is 1, because i have a windows .bat file, which checks this and in case of erros (exit code 1) i get a email.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
OK, can you post an output of the script and the script itself?
_________________
Martin Prikryl
rgbgerman
[View user's profile]

Joined: 2008-06-10
Posts: 7
Location: Germany
hi,

here is my script:

Code:

C:\Programme\WinSCP\WinSCP.exe /log=logfile.log /console /script=script.txt
if errorlevel 1 goto error

echo Success
E:\BIN\sendmail.exe -t < E:\WinSCP\ok_mail
goto end

:error
echo Error!
E:\BIN\sendmail.exe -t < E:\WinSCP\failed_mail

:end


and i always get errorlevel 1 ;-((
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
I've meant the script (script.txt), not the batch file.
Also the output of the script (e.g. screen capture) may help.
_________________
Martin Prikryl
rgbgerman
[View user's profile]

Joined: 2008-06-10
Posts: 7
Location: Germany
sorry Wink

Code:

# Automatically answer all prompts negatively not to stall
# the script on errors
option batch on
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect using a password
# open user:password@example.com
# Connect
open root:xxxxx@server2.xxxxxxx.de
# Change remote directory
#cd /home/backup/
# Force binary mode transfer
option transfer binary
# Download file to the local directory d:\
synchronize local -delete -nopermissions C:\BACKUP\ /home/backup/
# Disconnect
close
# Exit WinSCP
exit


its hard to capture the output, because when i start the batch windows opens a new window.
after the program has finished, the window closes immediately ;(

here is another part of the logfile:

Code:

. 2008-06-12 12:21:37.906 --------------------------------------------------------------------------
. 2008-06-12 12:21:37.906 Using SFTP protocol.
. 2008-06-12 12:21:37.906 Doing startup conversation with host.
> 2008-06-12 12:21:37.906 Type: SSH_FXP_INIT, Size: 5, Number: -1
< 2008-06-12 12:21:37.937 Type: SSH_FXP_VERSION, Size: 5, Number: -1
. 2008-06-12 12:21:37.937 SFTP version 3 negotiated.
. 2008-06-12 12:21:37.937 We believe the server has signed timestamps bug
. 2008-06-12 12:21:37.937 We will use UTF-8 strings for status messages only
. 2008-06-12 12:21:37.937 Limiting packet size to OpenSSH sftp-server limit of 262148 bytes
. 2008-06-12 12:21:37.937 Getting current directory name.
. 2008-06-12 12:21:37.937 Getting real path for '.'
> 2008-06-12 12:21:37.937 Type: SSH_FXP_REALPATH, Size: 10, Number: 16
< 2008-06-12 12:21:37.953 Type: SSH_FXP_NAME, Size: 31, Number: 16
. 2008-06-12 12:21:37.953 Real path is '/root'
. 2008-06-12 12:21:37.953 Startup conversation with host finished.
. 2008-06-12 12:21:37.953 Collecting synchronization list for local directory 'C:\BACKUP\' and remote directory '/home/backup/', mode = 1, params = 3
. 2008-06-12 12:21:37.953 Listing directory "/home/backup".
> 2008-06-12 12:21:37.953 Type: SSH_FXP_OPENDIR, Size: 21, Number: 267
< 2008-06-12 12:21:37.968 Type: SSH_FXP_HANDLE, Size: 13, Number: 267
> 2008-06-12 12:21:37.968 Type: SSH_FXP_READDIR, Size: 13, Number: 524
< 2008-06-12 12:21:38.000 Type: SSH_FXP_NAME, Size: 1491, Number: 524
> 2008-06-12 12:21:38.000 Type: SSH_FXP_READDIR, Size: 13, Number: 780
< 2008-06-12 12:21:38.015 Type: SSH_FXP_STATUS, Size: 28, Number: 780
< 2008-06-12 12:21:38.015 Status/error code: 1


at the end, you can see, there it says:

< 2008-06-12 12:21:38.015 Status/error code: 1

maybe it has something to do with the command

Listing directory "/home/backup"

thank you....
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
Script looks fine.

rgbgerman wrote:
its hard to capture the output, because when i start the batch windows opens a new window.
after the program has finished, the window closes immediately ;(

You have two options:
1) execute winscp.com and redirect it to file:
C:\Programme\WinSCP\WinSCP.com /log=logfile.log /console /script=script.txt > capture.log
2) remove exit command from the script, so that the window is not closed immediatelly.

Quote:
at the end, you can see, there it says:

< 2008-06-12 12:21:38.015 Status/error code: 1

maybe it has something to do with the command

It just says that the directory listing has reached the end.
_________________
Martin Prikryl
rgbgerman
[View user's profile]

Joined: 2008-06-10
Posts: 7
Location: Germany
hi,

okay, i didnt use exit in the script, and here is the output, all looks fine to me:



the black part in the middle is just the comparing of the directories.
i hope the "german" text is not a problem Wink

the last line says "unknown command #exit" but i think this is just a syntax failure
because of a missing whitespace.....
rgbgerman
[View user's profile]

Joined: 2008-06-10
Posts: 7
Location: Germany
oh my god... i have found the mistake... there was a "#cd" line in my script-file
and this is also a "unknown command". thats why the exit-code is 1. i have tested it.
know it works... oh my god... what a fu*** mistake...

sorry ! Wink and thanks for you help!
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
OK, I see. It is the "#cd .." line. The hash must be followed by space: "# cd ...".
_________________
Martin Prikryl
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
rgbgerman wrote:
oh my god... i have found the mistake... there was a "#cd" line in my script-file
and this is also a "unknown command". thats why the exit-code is 1. i have tested it.
know it works... oh my god... what a fu*** mistake...

Ok, I've missed your second post, so you have found it yourself Wink
_________________
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