Errorlevel is set to 1 when there is nothing to synchronize

Advertisement

Bascy
Joined:
Posts:
13

Errorlevel is set to 1 when there is nothing to synchronize

I'm using a script to synchronize a remote dir with a local one
After executing the script I examine the errorlevel var to see if everything is alright and noticed that errorlevel is set to 1 (or higher) when synchronize says "nothing to synchronize".

I think this is not correct, as the execution is done correctly, no errors occurred. So errorlevel should be 0 in this situation.

Dos commandfile:
winscp /console /script=WinScpPublishAM.txt /log="ftp%0.log" /parameter "%1"  >> "%LogFile%"
if errorlevel 1 set Errorsoccured=1
WinSCP script: (Id info obscured)
option batch on
option confirm off
option transfer bin
 
option exclude */
 
open -timeout=120 ftp://yyyyyyy:xxxxxxxx@www.sg-partners.nl
cd htdocs/lccam
cd "%1%"
synchronize remote \\sngserver02\SNGProducts\LCCAMQM31\INTL -criteria=both
close
exit
Logging: (some info obscured)
batch           on        
confirm         off       
transfer        binary    
exclude         */        
Connecting to www.sg-partners.nl ...
Connected with www.sg-partners.nl. Waiting for welcome message...
Connected
Starting the session...
Reading remote directory...
Session started.
Active session: [1] yyyyyyyy@www.sg-partners.nl
Comparing...
Local '\\sngserver02\SNGProducts\LCCAMQM31\INTL' => Remote '/31/beta'
Nothing to synchronize.
Session 'yyyyyyyy@www.sg-partners.nl' closed.
No session.

Reply with quote

Advertisement

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

Re: Errorlevel is set to 1 when there is nothing to synchronize

Bascy wrote:

I'm using a script to synchronize a remote dir with a local one
After executing the script I examine the errorlevel var to see if everything is alright and noticed that errorlevel is set to 1 (or higher) when synchronize says "nothing to synchronize"
I do not think this is true. Are you sure that the errorlevel is 0 when there is anything to synchronize?

Reply with quote

Bascy
Joined:
Posts:
13

Mmm, just tested it with a bare script ... and i have to agree with you
The errorlevel is not set to 1 on a "nothing to synchronize".

Guess my problem is caused by something else.

Reply with quote

Advertisement

You can post new topics in this forum