|
May 28, 2013, 06:32:59 PM Last edit: May 29, 2013, 03:07:01 PM by FiatKiller |
|
I have not actually HAD a card die since I got this going, but I'm 99% certain it will work. I did alot of research on various aspects of batchfile functions to piece this together. I know the cgwatcher program can do this, but this is simpler.
There are five steps:
1) Make a file in your cgminer directory called INPUT.txt with FILE=<name of cgminer batchfile> in it.
2) Put this line in all your various cg batchfiles: ECHO FILE=<name of cgminer batchfile> > INPUT.txt
3) Put the following into any batchfile name you want: (I use CG_Kill.bat)
REM Requires cgminer to be run with 2>Log.txt parameter AFTER REM starting this batchfile. REM Requires statement of FILE=<name of cgminer batchfile> REM in a file called INPUT.txt REM Also, in all your different cgminer batchfiles, put a REM line to ECHO it's name to the input file like: REM ECHO FILE=cg.bat > INPUT.txt
DEL Log.txt SET /A COUNT=0
:LOOP SET /A COUNT+=1 REM get name of current cgminer batchfile for /f "delims=" %%x in (INPUT.txt) do (set "%%x")
REM check for dead card and restart cgminer, if so... FINDSTR /m "DEAD" Log.txt if %errorlevel%==0 ( Taskkill /IM cgminer.exe /F TIMEOUT 10 ECHO %DATE% >> RESTARTS.txt ECHO %TIME% >> RESTARTS.txt DEL Log.txt REM insert name of cgminer start batchfile after this line START CALL %FILE% )
REM Deletes Logfile every hour so that searching it is quick enough. IF "%COUNT%" == "30" ( Taskkill /IM cgminer.exe /F TIMEOUT 10 DEL Log.txt SET /A COUNT=0 REM insert name of cgminer start batchfile after this line START CALL %FILE% )
REM wait two minutes to recheck for dead card TIMEOUT 120
GOTO LOOP
4) Requires cgminer to be run with 2>Log.txt parameter AFTER starting this batchfile.
5) Add an EXIT command after the cgminer command to your cg batchfiles. (prevent multiple open windows) So, if your cg batchfile was coinpool.bat you would have this in it:
ECHO FILE=coinpool.bat > INPUT.txt cgminer blah blah <parameters> 2>Log.txt EXIT
Note: it will restart cgminer once an hour as part of the process of not letting the logfile get too big.
|