Post a reply

Options
Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)

Options

Topic review

martin

Re: Script Stop with error on log after Call Command

Angelo wrote:

thank you, but the result is the same as soon as i use a call command. Get and put Commands are OK but after a Call, all the commands abort.

Well, the error message says it. The command has non-zero exit code. You previous command (tar) had exit code 0, so the redirection would help.
Angelo

Re: Script Stop with error on log after Call Command

martin wrote:

See https://winscp.net/eng/docs/scriptcommand_call

It is an error, if the command has any error output, but no standard output. To circumvent that redirect the error output to nul (2>/dev/null) or to the standard output (2>&1).



thank you, but the result is the same as soon as i use a call command. Get and put Commands are OK but after a Call, all the commands abort.

"
option batch abort
option confirm off

#open sftp://id:prod@55.5.5.555
open scp://id:prod@55.5.5.555

cd /app/g/fic
call ls -l 2>/dev/null
#call ls -l /dev/null 2>&1


option transfer binary
get *.gz D:\Expit\\PR\
close

exit


In the log file joined :
unalias "ls" ; echo "WinSCP: this is end-of-file:$?"
WinSCP: this is end-of-file:0

....
2015-02-25 14:50:44.271 Commande échouée avec pour code de retour 127.
2015-02-25 14:50:44.271 Script: Failed
2015-02-25 14:50:44.271 Script: Exit code: 1
2015-02-25 14:50:44.271 Closing connection.
2015-02-25 14:50:44.271 Sending special code: 12
2015-02-25 14:50:44.271 Sent EOF message
martin

Re: Script Stop with error on log after Call Command

See https://winscp.net/eng/docs/scriptcommand_call

It is an error, if the command has any error output, but no standard output. To circumvent that redirect the error output to nul (2>/dev/null) or to the standard output (2>&1).
Angelo

Script Stop with error on log after Call Command

Hello,

I don't understand why this script stop after the Call Command.
The Command call produce a file but there are errors in the log and the Script attempt to connect again to the server....
I join the log file as attached

Thank you for your help

Angelo

option batch abort
option confirm off
open sftp://idbut:prod76@55.5.5.555
open scp://idbut:prod76@55.5.5.555
cd /app/fic

#Care ferme la session....
#apparemment ouvre une session au moment du Call !!!
call tar cvf - /app/sql/ | gzip -c > MIsql22.tar.gz

option transfer binary
get *.gz D:\Exploitation\w\
close
exit
#Lancement
#C:\PROGRA~1\WinSCP\winscp.com /script=D:\Exploitation\w\CDESWI~1\winscpscpcallforum1.txt /log="D:\Exploitation\w\CDESWI~1\\winscpscpcallforum1.log" /loglevel=2