Posts Tagged ‘restart miner software


There were some people asking for a simple solution to automate the process of restarting a miner software every few hours in order to be sure that it is working fine under Windows OS. The below Batch file code example offers a simple and easy way to do that and it uses sandor’s fork of cpuminer for Gridseed Scrypt ASICs as an example. You need to set the parameters based on the miner and command line you use as well as the time after which the miner process will be killed (default 4 hours), then the script will wait for 10 seconds and start the miner again. There is also a counter to show you the number of restarts that have been executed since you’ve started the Batch script.

@echo off

echo -------------------------------------------------------------------
echo Simple script to restart your miner software after a period of time
echo -------------------------------------------------------------------

set executable=minerd.exe
set commandline=--freq=1150 --gc3355=\\.\COM1 --url=stratum+tcp:// --userpass=yourworker.1:password
set runforseconds=14400
set restartinseconds=10
set /a counter=0

start "Miner Window" %executable% %commandline%
echo The software will run for %runforseconds% seconds
timeout %runforseconds%
taskkill /f /im %executable%
echo Restarting the software in %restartinseconds% seconds (%counter%)
timeout %restartinseconds%
set /a counter+=1
goto start

In order to use the code above you just have to copy it and save as a .BAT file as well as to modify some of the variables as per your needs and requirements and then run it. Do note that you will get two program windows, one that will have the Batch script running and another for the miner software. You should not close the windows with the script running as this will stop the execution of the script immediately and the miner software will not be restarted anymore.