Result code 1 after synchronize without doing anything

Advertisement

rgbgerman
Joined:
Posts:
7
Location:
Germany

Result code 1 after synchronize without doing anything

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:
> 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) Shouldn't it be error code 0, because there is nothing to do ???

Any idea????

Reply with quote

Advertisement

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

Re: Result code 1 after synchronize without doing anything

Do you mean the exit code of winscp process is 1, or do you just refer to the code in the log?

Reply with quote

rgbgerman
Joined:
Posts:
7
Location:
Germany

hi,

here is my script:
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 ;-((

Reply with quote

Advertisement

martin
Site Admin
martin avatar

I've meant the script (script.txt), not the batch file.
Also the output of the script (e.g. screen capture) may help.

Reply with quote

rgbgerman
Joined:
Posts:
7
Location:
Germany

sorry ;-)
# 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:
. 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....

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
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 imediatelly.

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.

Reply with quote

rgbgerman
Joined:
Posts:
7
Location:
Germany

hi,

okay, i didn't 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 ;)

the last line says "unknown command #exit" but i think this is just a syntax failure
because of a missing whitespace.....

Reply with quote

Advertisement

rgbgerman
Joined:
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". that's why the exit-code is 1. i have tested it.
know it works... oh my god... what a fu*** mistake...

sorry ! ;) and thanks for you help!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
41,441
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". that's 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 ;-)

Reply with quote

Advertisement

You can post new topics in this forum