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

tcheric

Thanks for getting back to me.

I used to run a more recent version until I started getting problem with the Data.fs file because of its size. This is the reason why, after checking some posts in this forum, I decided to switch to the v. 4.1.9
With 4.1.9, I am able to copy the Data.fs file across, BUT, still, I am getting this error code at the end.

I hope this makes sense.

Thanks,
Eric.
martin

Re: ERRORLEVEL = 1 on script, despite file being transferred

Please upgrade to the lastest stable version. Than look for "Script: Failed" in the session log to find a cause for the error code.
Guest

Re: ERRORLEVEL = 1 on script, despite file being transferred

Adding the full logs as attachment.
Thanks.
Guest

ERRORLEVEL = 1 on script, despite file being transferred

Hi

I have found several posts on this topic in this forum, but somehow, none of them seems to apply to my case.
Hoping someone can point me in the right direction.

Thanks

Here is my code:
@ECHO OFF


REM
REM Backup
REM
REM Delete log file of previous day
IF EXIST C:\Scripts\boro_remote_daily.log DEL C:\Scripts\boro_remote_daily.log
REM
REM Execute the backup command.
"C:\Program Files\WinSCP\WinSCP.com" /script=C:\Scripts\boro_backup_script.txt /ini=C:\Scripts\WinSCP.ini /log=C:\Scripts\boro_remote_daily.log


IF ERRORLEVEL 1 GOTO error

REM
REM success handler
REM
REM
ECHO success.
REM Generate email header
ECHO FROM: [email protected] >> %TEMP%\temp.mail
ECHO To: [email protected]. >> %TEMP%\temp.mail
ECHO Subject: Success: The remote backup of BORO Website was successful >> %TEMP%\temp.mail
ECHO.>> %TEMP%\temp.mail
REM
REM Empty email.
REM Send email
c:\usr\lib\sendmail.exe -t < %TEMP%\temp.mail

GOTO cleanup


REM
REM error handler
REM
:error
REM
ECHO Failure.
REM Generate email header
ECHO FROM: [email protected] >> %TEMP%\temp.mail
ECHO To: [email protected]. >> %TEMP%\temp.mail
ECHO CC: [email protected]. >> %TEMP%\temp.mail
ECHO CC: [email protected]. >> %TEMP%\temp.mail
ECHO Subject: Failure: The remote backup of BORO Website failed %ERRORLEVEL% >> %TEMP%\temp.mail
ECHO.>> %TEMP%\temp.mail
REM
REM Create email file (Header + Body)
COPY /B %TEMP%\temp.mail+C:\Scripts\boro_remote_daily.log %TEMP%\temp1.mail

REM Send email
c:\usr\lib\sendmail.exe -t < %TEMP%\temp1.mail

GOTO cleanup

REM
REM Cleanup tasks
REM
:cleanup
REM
ECHO Cleanup
REM Delete email header file
IF EXIST %TEMP%\temp.mail DEL %TEMP%\temp.mail

REM
REM Delete email file
IF EXIST %TEMP%\temp1.mail DEL %TEMP%\temp1.mail

REM DEL C:\Scripts\boro_remote_daily.log


And here my WinSCP script

# Automatically answer all prompts negatively not to stall

# the script on errors

option batch continue

# Disable overwrite confirmations that conflict with the previous
# option confirm off

option reconnecttime 10

open boro

synchronize local -criteria=time C:\Backups\BORO\Mirror\parts\instance\Extensions /opt/Plone/boro/parts/instance/Extensions

synchronize local -criteria=time C:\Backups\BORO\Mirror\parts\instance\Products /opt/Plone/boro/parts/instance/Products

synchronize local -criteria=time C:\Backups\BORO\Mirror\parts\productdistros /opt/Plone/boro/parts/productdistros

option include "/opt/Plone/boro/parts/instance/etc/zope.conf"
synchronize local -criteria=time C:\Backups\BORO\Mirror\parts\instance\etc /opt/Plone/boro/parts/instance/etc/

option include "/opt/Plone/boro/var/filestorage/Data.fs.tgz"
synchronize local -criteria=time C:\Backups\BORO\Mirror\var\filestorage /opt/Plone/boro/var/filestorage

close

exit


Log file generated:
[code:1:998099e592]. 2012-05-27 17:14:21.468 --------------------------------------------------------------------------
. 2012-05-27 17:14:21.468 WinSCP Version 4.1.9 (Build 416) (OS 5.2.3790 Service Pack 2)
. 2012-05-27 17:14:21.468 Login time: 27 May 2012 17:14:21
. 2012-05-27 17:14:21.468 --------------------------------------------------------------------------
. 2012-05-27 17:14:21.468 Session name: boro
. 2012-05-27 17:14:21.468 Host name: xx.xxx.xx.xxx (Port: 22)
. 2012-05-27 17:14:21.468 User name: boro (Password: Yes, Key file: No)
. 2012-05-27 17:14:21.468 Tunnel: No
. 2012-05-27 17:14:21.468 Transfer Protocol: SFTP (SCP)
. 2012-05-27 17:14:21.468 Ping type: -, Ping interval: 30 sec; Timeout: 15 sec
. 2012-05-27 17:14:21.468 Proxy: none
. 2012-05-27 17:14:21.468 SSH protocol version: 2; Compression: No
. 2012-05-27 17:14:21.468 Bypass authentication: No
. 2012-05-27 17:14:21.468 Try agent: Yes; Agent forwarding: No; TIS/CryptoCard: No; KI: Yes; GSSAPI: No
. 2012-05-27 17:14:21.468 Ciphers: aes,blowfish,3des,WARN,arcfour,des; Ssh2DES: No
. 2012-05-27 17:14:21.468 SSH Bugs: -,-,-,-,-,-,-,-
. 2012-05-27 17:14:21.468 SFTP Bugs: -,-
. 2012-05-27 17:14:21.468 Return code variable: Autodetect; Lookup user groups: Yes
. 2012-05-27 17:14:21.468 Shell: default, EOL: 0
. 2012-05-27 17:14:21.468 Clear aliases: Yes, Unset nat.vars: Yes, Resolve symlinks: Yes
. 2012-05-27 17:14:21.468 LS: ls -la, Ign LS warn: Yes, Scp1 Comp: No
. 2012-05-27 17:14:21.468 Local directory: default, Remote directory: /home/boro, Update: No, Cache: Yes
. 2012-05-27 17:14:21.468 Cache directory changes: Yes, Permanent: Yes
. 2012-05-27 17:14:21.468 DST mode: 1
. 2012-05-27 17:14:21.468 --------------------------------------------------------------------------
. 2012-05-27 17:14:21.468 Looking up host "xx.xxx.xx.xxx"
. 2012-05-27 17:14:21.468 Connecting to xx.xxx.xx.xxx port 22
. 2012-05-27 17:14:21.531 Server version: SSH-2.0-OpenSSH_4.2p1 Debian-7ubuntu3.5
. 2012-05-27 17:14:21.531 We claim version: SSH-2.0-WinSCP_release_4.1.9
. 2012-05-27 17:14:21.578 SSPI: acquired credentials for: tchepannoue@BALDER
. 2012-05-27 17:14:21.578 Cannot convert IP address to SPN: DNS is not trusted
. 2012-05-27 17:14:21.578 GSSKEX disabled: The operation completed successfully.

. 2012-05-27 17:14:21.593 Using SSH protocol version 2
. 2012-05-27 17:14:21.609 Doing Diffie-Hellman group exchange
. 2012-05-27 17:14:21.687 Doing Diffie-Hellman key exchange with hash SHA-1
. 2012-05-27 17:14:21.953 Host key fingerprint is:
. 2012-05-27 17:14:21.953 ssh-rsa 2048 bf:37:17:5f:6d:74:80:d8:c5:3a:46:7a:7f:4f:9c:42
. 2012-05-27 17:14:21.953 Initialised AES-256 CBC client->server encryption
. 2012-05-27 17:14:21.953 Initialised HMAC-SHA1 client->server MAC algorithm
. 2012-05-27 17:14:21.953 Initialised AES-256 CBC server->client encryption
. 2012-05-27 17:14:21.953 Initialised HMAC-SHA1 server->client MAC algorithm
! 2012-05-27 17:14:22.046 Using username "boro".
. 2012-05-27 17:14:22.109 Keyboard-interactive authentication refused
. 2012-05-27 17:14:22.109 Prompt (6, SSH password, , &Password: )
. 2012-05-27 17:14:22.109 Using stored password.
. 2012-05-27 17:14:22.109 Sent password
. 2012-05-27 17:14:22.156 Access granted
. 2012-05-27 17:14:22.171 Opened channel for session
. 2012-05-27 17:14:22.203 Primary command failed; attempting fallback
. 2012-05-27 17:14:22.234 Started a shell/command
. 2012-05-27 17:14:22.234 --------------------------------------------------------------------------
. 2012-05-27 17:14:22.234 Using SCP protocol.
. 2012-05-27 17:14:22.234 Doing startup conversation with host.
. 2012-05-27 17:14:22.234 Skipping host startup message (if any).
> 2012-05-27 17:14:22.234 echo "WinSCP: this is end-of-file:0"
< 2012-05-27 17:14:22.328 WinSCP: this is end-of-file:0
. 2012-05-27 17:14:22.328 Detecting variable containing return code of last command.
. 2012-05-27 17:14:22.328 Trying "$status".
> 2012-05-27 17:14:22.328 echo "$status" ; echo "WinSCP: this is end-of-file:0"
< 2012-05-27 17:14:22.421 WinSCP: this is end-of-file:0
. 2012-05-27 17:14:22.421 Trying "$?".
> 2012-05-27 17:14:22.421 echo "$?" ; echo "WinSCP: this is end-of-file:0"
< 2012-05-27 17:14:22.515 0
< 2012-05-27 17:14:22.515 WinSCP: this is end-of-file:0
. 2012-05-27 17:14:22.515 Return code variable "$?" selected.
. 2012-05-27 17:14:22.515 Clearing all aliases.
> 2012-05-27 17:14:22.515 unalias "ls" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:22.609 -sh: line 4: unalias: ls: not found
< 2012-05-27 17:14:22.609 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:22.609 unalias "echo" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:22.703 -sh: line 5: unalias: echo: not found
< 2012-05-27 17:14:22.703 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:22.703 unalias "pwd" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:22.796 -sh: line 6: unalias: pwd: not found
< 2012-05-27 17:14:22.796 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:22.796 unalias "cd" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:22.890 -sh: line 7: unalias: cd: not found
< 2012-05-27 17:14:22.890 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:22.890 unalias "groups" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:22.984 -sh: line 8: unalias: groups: not found
< 2012-05-27 17:14:22.984 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:22.984 unalias "scp" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.078 -sh: line 9: unalias: scp: not found
< 2012-05-27 17:14:23.078 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.078 unalias "rm" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.171 -sh: line 10: unalias: rm: not found
< 2012-05-27 17:14:23.171 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.171 unalias "mv" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.312 -sh: line 11: unalias: mv: not found
< 2012-05-27 17:14:23.312 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.312 unalias "mkdir" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.406 -sh: line 12: unalias: mkdir: not found
< 2012-05-27 17:14:23.406 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.406 unalias "chmod" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.500 -sh: line 13: unalias: chmod: not found
< 2012-05-27 17:14:23.500 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.500 unalias "chgrp" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.593 -sh: line 14: unalias: chgrp: not found
< 2012-05-27 17:14:23.593 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.593 unalias "chown" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.687 -sh: line 15: unalias: chown: not found
< 2012-05-27 17:14:23.687 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.687 unalias "unset" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.781 -sh: line 16: unalias: unset: not found
< 2012-05-27 17:14:23.781 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.781 unalias "unalias" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.859 -sh: line 17: unalias: unalias: not found
< 2012-05-27 17:14:23.859 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.875 unalias "ln" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:23.953 -sh: line 18: unalias: ln: not found
< 2012-05-27 17:14:23.953 WinSCP: this is end-of-file:1
> 2012-05-27 17:14:23.968 unalias "cp" ; echo "WinSCP: this is end-of-file:$?"
! 2012-05-27 17:14:24.062 -sh: line 19: unalias: cp: not found
< 2012-05-27 17:14:24.062 WinSCP: this is end-of-file:1
. 2012-05-27 17:14:24.062 Clearing national user variables.
> 2012-05-27 17:14:24.062 unset "LANG" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:24.156 WinSCP: this is end-of-file:0
> 2012-05-27 17:14:24.156 unset "LANGUAGE" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:24.250 WinSCP: this is end-of-file:0
> 2012-05-27 17:14:24.250 unset "LC_CTYPE" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:24.343 WinSCP: this is end-of-file:0
> 2012-05-27 17:14:24.343 unset "LC_COLLATE" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:24.437 WinSCP: this is end-of-file:0
> 2012-05-27 17:14:24.437 unset "LC_MONETARY" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:24.531 WinSCP: this is end-of-file:0
> 2012-05-27 17:14:24.531 unset "LC_NUMERIC" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:24.625 WinSCP: this is end-of-file:0
> 2012-05-27 17:14:24.625 unset "LC_TIME" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:24.718 WinSCP: this is end-of-file:0
> 2012-05-27 17:14:24.718 unset "LC_MESSAGES" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:24.812 WinSCP: this is end-of-file:0
> 2012-05-27 17:14:24.812 unset "LC_ALL" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:24.906 WinSCP: this is end-of-file:0
> 2012-05-27 17:14:24.906 unset "HUMAN_BLOCKS" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:25.000 WinSCP: this is end-of-file:0
. 2012-05-27 17:14:25.015 Looking up groups and users.
> 2012-05-27 17:14:25.015 groups ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:25.109 root
< 2012-05-27 17:14:25.281 WinSCP: this is end-of-file:0
. 2012-05-27 17:14:25.281 Following groups found:
. 2012-05-27 17:14:25.281 root
. 2012-05-27 17:14:25.281 No users found.
. 2012-05-27 17:14:25.281 Changing directory to "/home/boro".
> 2012-05-27 17:14:25.281 cd "/home/boro" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:25.375 WinSCP: this is end-of-file:0
. 2012-05-27 17:14:25.390 Getting current directory name.
> 2012-05-27 17:14:25.390 pwd ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:25.484 /home/boro
< 2012-05-27 17:14:25.484 WinSCP: this is end-of-file:0
. 2012-05-27 17:14:25.484 Startup conversation with host finished.
. 2012-05-27 17:14:25.484 Collecting synchronization list for local directory 'C:\Backups\BORO\Mirror\parts\instance\Extensions' and remote directory '/opt/Plone/boro/parts/instance/Extensions', mode = 1, params = 2
. 2012-05-27 17:14:25.484 Listing directory "/opt/Plone/boro/parts/instance/Extensions".
> 2012-05-27 17:14:25.484 ls -la --full-time "/opt/Plone/boro/parts/instance/Extensions" ; echo "WinSCP: this is end-of-file:$?"
< 2012-05-27 17:14:25.593 total 12
< 2012-05-27 17:14:25.593 drwxr-xr-x 2 root root 4096 2011-02-24 12:34:54.000000000 +0000 .