Bitcoin Forum

Bitcoin => Mining support => Topic started by: Minlukaz on April 10, 2013, 09:30:55 AM



Title: Is there a way to automatically restart cgminer when it stops mining?
Post by: Minlukaz on April 10, 2013, 09:30:55 AM
I'm not super good with scripting files so I wouldn't even know where to begin with this.

I found something on this forum for at one point but haven't been able to locate it since. It basically follows the workflow that if cgminer stops mining, it'll stop the process, close it, reopen it, and then restart mining with a specific card (every 2 hours or so, just in case maybe?). So while it may not require Logmein access it can sort of fix itself if I don't catch it. I'm using windows and not linux if that helps, so I don't have access to watchdog.

Thanks in advance.


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: salihno71 on April 10, 2013, 11:47:20 AM
Which platform are you mining on? Win/linux?


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: crazyates on April 10, 2013, 07:24:05 PM
I'm using windows and not linux if that helps, so I don't have access to watchdog.
Which platform are you mining on? Win/linux?
Herpy dee derp.

Just run CGMiner in a .bat file. Here's an example:

Code:
:loop
C:\cgminer\cgminer.exe -c C:\Users\User\cgminer2.conf
timeout /T 10
goto loop


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: FatMagic on April 12, 2013, 11:19:59 PM
Just run CGMiner in a .bat file. Here's an example:

Code:
:loop
C:\cgminer\cgminer.exe -c C:\Users\User\cgminer2.conf
timeout /T 10
goto loop

Nice! I didn't know this! Thanks it works great.


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: szita2000 on April 16, 2013, 03:28:29 PM
or drag and drop your shortcut in to the windows startup from the start menu


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: GoldSeal on April 17, 2013, 12:54:16 AM
If you are on linux you can use monit. It'll even notify you when it restarts the service, etc: http://mmonit.com/monit/


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: jml on April 20, 2013, 06:42:53 PM
In linux, you can create a bash file that checks the process of cgminer. You then can use crontab to poll the process every minute to see if it exists. If not, then restart the cgminer process. Another alternative is to code in C a daemon that runs in the background that does this task for you.


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: demosthenez on April 21, 2013, 12:39:25 AM
Have a look at CGWatcher.
It uses cgminer's API to restart cgminer and can also restart SICK/DEAD GPU's


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: FatMagic on April 22, 2013, 07:02:34 PM
Have a look at CGWatcher.
It uses cgminer's API to restart cgminer and can also restart SICK/DEAD GPU's

Thanks for this! I was trying to use Akbash without much success. I will try CGWatcher to see if it's any better :)


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: reb0rn21 on September 10, 2013, 07:48:17 PM
Just run CGMiner in a .bat file. Here's an example:

Code:
:loop
C:\cgminer\cgminer.exe -c C:\Users\User\cgminer2.conf
timeout /T 10
goto loop

Nice! I didn't know this! Thanks it works great.

Will this help if cgminer just frezz... i can`t use cgwatcher because my main display GPU is intel and i have no access to ATI adl


Title: Re: Is there a way to automatically restart cgminer when it stops mining?
Post by: milone on September 11, 2013, 06:52:57 AM
Will this help if cgminer just frezz... i can`t use cgwatcher because my main display GPU is intel and i have no access to ATI adl

Have you tried using CGWatcher? ADL and NVAPI (Nvidia) are what I use to get GPU info at the moment because I'm not sure there are enough people mining with Intel GPUs to warrant it. I am getting CPU info, including temps, but not doing anything with it because I don't have an Intel GPU to test with and again, it's not very common. But if you also have a discrete AMD or Nvidia card, CGWatcher should have the info for it. If it can use OpenCL and cgminer can see it, CGWatcher should have no problem with it. CGWatcher also loads OpenCL devices and information independent from the miner, but if a device is reported by cgminer that for some reason (unlikely) wasn't reported by OpenCL, CGWatcher adds it anyway.

Regardless, most of the data related to determining if the miner stops mining comes from the miner and doesn't depend on the type of GPU (except for temperatures in some cases). If you're mining with an Intel GPU, cgminer should be providing enough info for most monitoring options in CGWatcher to work. The only ones that will not are temperature related, because CGWatcher currently doesn't do anything with this info and cgminer doesn't get it at all. But accepted shares, non-responding miners, etc. should work for any GPU that cgminer is capable of using.