Author

Topic: Autorestart a batchfile if a exe file freeze? (Read 258 times)

member
Activity: 84
Merit: 10
October 29, 2017, 09:25:16 PM
#6
Hello,

is there a way to autorestat a Batchfile if a exe freeze?


For example i start my miner threw a batchfile. If the miner freeze i need a tool which get the freeze close the programm a restart it through the batchfile.

There are ways to do what you want using openhardwaremonitor from http://openhardwaremonitor.org/ but programmatically killing programs and then starting them again is kind of a pain, especially when the programs are called from batch files to begin with so you need to kill batch files and exe files.  If you have a dedicated mining computer (like it isn't your home PC) then you should set it up to autologin and start mining when it gets turned on.  Then the simplest and most reliable way to recover from hung miners is to detect that it is hung and just reboot.  So if there is an associated log entry (like a driver crash) then you can simply setup a scheduled task to run a script that reboots the computer every time the event log is triggered.  Alternatively, you can use a periodic task that calls a script to use openhardwaremonitor to check for GPU usage % and if it seems like it isn't maxed, perform a reboot.  I actually posted a thread with a batch file I created using openhardwaremonitor for something like that around here somewhere if you want to go look for it.  The issue there is that work restarts from the pool will cause GPU % to go down, so you have to do a number of checks in a short period of time and figure out how many low % values you want to consider it a hung miner for a reboot.  If the script runs and just happens to check GPU % when pool work restarts are being sent then it may think the miner is hung when it isn't.  That's why something simple like an event log entry is the best solution if that will work for what you are experiencing.


Thank you already got it running. With restart if miner freeze and batch on startup.
member
Activity: 84
Merit: 10
Well thanks for your answers. I could handle this with a "check if miner freeze then reboot computer" because on startup my batchfile is starting set my gpus like it should and start mining. But i dont see a good(easy) way of checking if miner freeze close miner restart batchfile?
legendary
Activity: 1726
Merit: 1018
Hello,

is there a way to autorestat a Batchfile if a exe freeze?


For example i start my miner threw a batchfile. If the miner freeze i need a tool which get the freeze close the programm a restart it through the batchfile.

There are ways to do what you want using openhardwaremonitor from http://openhardwaremonitor.org/ but programmatically killing programs and then starting them again is kind of a pain, especially when the programs are called from batch files to begin with so you need to kill batch files and exe files.  If you have a dedicated mining computer (like it isn't your home PC) then you should set it up to autologin and start mining when it gets turned on.  Then the simplest and most reliable way to recover from hung miners is to detect that it is hung and just reboot.  So if there is an associated log entry (like a driver crash) then you can simply setup a scheduled task to run a script that reboots the computer every time the event log is triggered.  Alternatively, you can use a periodic task that calls a script to use openhardwaremonitor to check for GPU usage % and if it seems like it isn't maxed, perform a reboot.  I actually posted a thread with a batch file I created using openhardwaremonitor for something like that around here somewhere if you want to go look for it.  The issue there is that work restarts from the pool will cause GPU % to go down, so you have to do a number of checks in a short period of time and figure out how many low % values you want to consider it a hung miner for a reboot.  If the script runs and just happens to check GPU % when pool work restarts are being sent then it may think the miner is hung when it isn't.  That's why something simple like an event log entry is the best solution if that will work for what you are experiencing.
hero member
Activity: 966
Merit: 513
It could be probably done neatly but I just use two batfiles to restart the miner periodically;

the miner .bat file:

:loop
miner.exe ...
goto loop


so that the miner will restart if closed and the second .bat is closing the miner periodically (every hour in this example):

:loop
timeout -t 3600
taskkill -t -f /im miner.exe
goto loop




This is the manual operation to mine the bitcoins with the batch file. You need to set the .bat file with the wallet address and reset=o Some of the batch file with cg or claymore software's batch file reset value can be increased to 1 or 2.
Is there are any miner sotware reset automatically without the help of the manual interventions.
legendary
Activity: 2002
Merit: 1051
ICO? Not even once.
It could be probably done neatly but I just use two batfiles to restart the miner periodically;

the miner .bat file:

:loop
miner.exe ...
goto loop


so that the miner will restart if closed and the second .bat is closing the miner periodically (every hour in this example):

:loop
timeout -t 3600
taskkill -t -f /im miner.exe
goto loop


member
Activity: 84
Merit: 10
Hello,

is there a way to autorestat a Batchfile if a exe freeze?


For example i start my miner threw a batchfile. If the miner freeze i need a tool which get the freeze close the programm a restart it through the batchfile.
Jump to: