Post a reply

Before posting, please read how to report bug or request support effectively.

Bug reports without an attached log file are usually useless.

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

Sekhar

Script Retrying success statements as well instead of only failed

Hello Team,

I have list of files to be downloaded/transfer from a remote server to my local server. When one of the file got failed then script is retrying all the files again. But i need to retry only failed file. Please help with a solution.

I am using below scritp.

@echo off

set TRIES=0
set INTERVAL=10
 
:retry
 
winscp.exe /console ^
      /script=E:\AutoMIS\Airtel_Daily\log.tmp ^
      /log=E:\AutoMIS\Airtel_Daily\logs\%DATE:~10,4%-%DATE:~4,2%-%DATE:~7,2%.log


if %ERRORLEVEL% neq 0 (
   set /A TRIES=%TRIES%-1
   if %TRIES% gtr 1 (
       echo Failed, retrying in %INTERVAL% seconds...
       timeout /t %INTERVAL%
       goto retry
   ) else (
       echo Error!
       sendmail.exe -t < error_mail.txt
       exit /b 1
   )
)

 
echo Success
sendmail.exe -t < success_mail.txt
exit /b 0