Bitcoin Forum
December 11, 2016, 12:06:47 PM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Turn miner on/off  (Read 1861 times)
mewantsbitcoins
Full Member
***
Offline Offline

Activity: 126


View Profile
May 05, 2011, 02:00:26 PM
 #1

I would like my miner to turn on/off at a specific time of day. What is the best way to go about it? Has anyone maybe got a script for that? Solutions for both Linux and Windows are welcome.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
Dayofswords
Member
**
Offline Offline

Activity: 98



View Profile
May 05, 2011, 09:00:10 PM
 #2

or if on windows, the task scheduler that no one uses these days


(i need to learn cron...)

142u3uafy7bvxJXArDF9mo9e6LEFSef5Hr
grndzero
Sr. Member
****
Offline Offline

Activity: 392


View Profile
May 05, 2011, 09:31:42 PM
 #3

Starting a process on either OS is pretty easy from either Task Scheduler or cron.

Stopping them is a little harder. I don't know about Windows, but the tools are already exist in linux to parse the process list to get the process id's of your miners and pass them along to the kill command. I know pslist from pstools will give you a list of precess id's on windows but you would have to come up with something else to parse the list and find the id's you're looking for.

I already have scripts to kill my miners and restart them from the command line and tested them with cron in linux.

Ubuntu Desktop x64 -  HD5850 Reference - 400Mh/s w/ cgminer  @ 975C/325M/1.175V - 11.6/2.1 SDK
Donate if you find this helpful: 1NimouHg2acbXNfMt5waJ7ohKs2TtYHePy
dust
Hero Member
*****
Offline Offline

Activity: 840



View Profile WWW
May 05, 2011, 09:54:14 PM
 #4

On linux, use cron with

Code:
pkill -9 poclbm
for poclbm or

Code:
pkill -9 python
for pheonix

Cryptocoin Mining Info | OTC | PGP | Twitter | freenode: dust-otc | BTC: 1F6fV4U2xnpAuKtmQD6BWpK3EuRosKzF8U
grndzero
Sr. Member
****
Offline Offline

Activity: 392


View Profile
May 05, 2011, 10:10:05 PM
 #5

On linux, use cron with

Code:
pkill -9 poclbm
for poclbm or

Code:
pkill -9 python
for pheonix

on ubuntu both programs look like:

/usr/bin/python ./phoenix.py
/usr/bin/python ./poclbm.py

and they aren't the only programs that are python scripts so just killing python could kill other system programs inadvertently

if pgrep phoenix or poclbm returns the right pids then pkill should work for both

Ubuntu Desktop x64 -  HD5850 Reference - 400Mh/s w/ cgminer  @ 975C/325M/1.175V - 11.6/2.1 SDK
Donate if you find this helpful: 1NimouHg2acbXNfMt5waJ7ohKs2TtYHePy
dust
Hero Member
*****
Offline Offline

Activity: 840



View Profile WWW
May 05, 2011, 10:25:36 PM
 #6

Grndzero, you are correct that pkill could interfere with other processes.  My mining systems are dedicated and there are no other processes named "python".

Cryptocoin Mining Info | OTC | PGP | Twitter | freenode: dust-otc | BTC: 1F6fV4U2xnpAuKtmQD6BWpK3EuRosKzF8U
grndzero
Sr. Member
****
Offline Offline

Activity: 392


View Profile
May 05, 2011, 10:33:02 PM
 #7

Grndzero, you are correct that pkill could interfere with other processes.  My mining systems are dedicated and there are no other processes named "python".

Mine is also, but when I originally wrote my kill scripts (not knowing about pkill and pgrep) and seeing that the primary process was python, not the script I found 1 or 2 other processes (I think they are services) on ubuntu that python is the primary process for.

Ubuntu Desktop x64 -  HD5850 Reference - 400Mh/s w/ cgminer  @ 975C/325M/1.175V - 11.6/2.1 SDK
Donate if you find this helpful: 1NimouHg2acbXNfMt5waJ7ohKs2TtYHePy
Vwlopez3
Member
**
Offline Offline

Activity: 78


View Profile WWW
May 05, 2011, 10:47:58 PM
 #8

Yes i would also be interested in this perhaps a windows option?

19G8b28qHHM7yACCwwWfikGv7QimEsHyga
grndzero
Sr. Member
****
Offline Offline

Activity: 392


View Profile
May 05, 2011, 10:52:45 PM
 #9

Yes i would also be interested in this perhaps a windows option?

Looks like you can kill processes by name from the command prompt (or batch file) with taskkill

http://www.addictivetips.com/windows-tips/kill-processes-from-the-command-prompt-in-windows-7/

Ubuntu Desktop x64 -  HD5850 Reference - 400Mh/s w/ cgminer  @ 975C/325M/1.175V - 11.6/2.1 SDK
Donate if you find this helpful: 1NimouHg2acbXNfMt5waJ7ohKs2TtYHePy
[Tycho]
Hero Member
*****
Offline Offline

Activity: 742



View Profile WWW
May 05, 2011, 11:32:56 PM
 #10

Starting a process on either OS is pretty easy from either Task Scheduler or cron.
Stopping them is a little harder.
I'm not sure about windows 7, but in previous versions you can set maximum running time for a sheduled task, after which it will be killed automatically.

Welcome to my bitcoin mining pool: https://deepbit.net - Both payment schemes (including PPS), instant payout, no invalid blocks !
ICBIT Trading platform : USD/BTC futures trading, Bitcoin difficulty futures (NEW!). Third year in bitcoin business.
grndzero
Sr. Member
****
Offline Offline

Activity: 392


View Profile
May 05, 2011, 11:39:15 PM
 #11

Starting a process on either OS is pretty easy from either Task Scheduler or cron.
Stopping them is a little harder.
I'm not sure about windows 7, but in previous versions you can set maximum running time for a sheduled task, after which it will be killed automatically.

Create Task, Settings

Stop If Task Runs Longer Than:
1,2,4,8,12 hours or 1,3 days ... can't manually input values

suck

Ubuntu Desktop x64 -  HD5850 Reference - 400Mh/s w/ cgminer  @ 975C/325M/1.175V - 11.6/2.1 SDK
Donate if you find this helpful: 1NimouHg2acbXNfMt5waJ7ohKs2TtYHePy
mintymark
Sr. Member
****
Offline Offline

Activity: 272


View Profile
May 05, 2011, 11:40:27 PM
 #12

I use a script that does the stopping and starting. I posted a slightly earlier version of it here

http://bitcointalk.org/index.php?topic=6307.msg94337#msg94337

It also has the feature that you can make the mier work only when not using the computer if you want.

If you want to make it work only at certain times, use this script and cron.

All of this is linux only, I'm afraid.


[[ All Tips gratefully received!!  ]]
15ta5d1N8mKkgC47SRWmnZABEFyP55RrqD
marcus_of_augustus
Legendary
*
Offline Offline

Activity: 2100



View Profile
May 05, 2011, 11:50:13 PM
 #13

On linux, use cron with

Code:
pkill -9 poclbm
for poclbm or

Code:
pkill -9 python
for pheonix

on ubuntu both programs look like:

/usr/bin/python ./phoenix.py
/usr/bin/python ./poclbm.py

and they aren't the only programs that are python scripts so just killing python could kill other system programs inadvertently

if pgrep phoenix or poclbm returns the right pids then pkill should work for both

Both phoenix and poclbm can be started by using the explicit python call (from inside the relevant directory or using the absolute path)

eg.

$python phoenix -u .....

or

$python poclbm -u ....

so on a dedicated mining rig without other python called processes running "$pkill -9 python" would work fine from cron. I've always wondered what the difference is between using the python prefix command or just the $./process.py ... doesn't seem to make a difference to hashrate but who knows ...

mintymark
Sr. Member
****
Offline Offline

Activity: 272


View Profile
May 06, 2011, 08:00:14 AM
 #14

Moa,

Its not a good idea to use the -9 argument here. This shuts down the processes without allowing them to do shutdown gracefully. just use kill <processid> or pkill <processname> and this will give the process a chance to shutdown correctly.

[[ All Tips gratefully received!!  ]]
15ta5d1N8mKkgC47SRWmnZABEFyP55RrqD
marcus_of_augustus
Legendary
*
Offline Offline

Activity: 2100



View Profile
May 06, 2011, 11:20:39 AM
 #15

Moa,

Its not a good idea to use the -9 argument here. This shuts down the processes without allowing them to do shutdown gracefully. just use kill <processid> or pkill <processname> and this will give the process a chance to shutdown correctly.

Yeah, you are right ... i've got into bad habit of always kill -9 since I mostly use it on hung/runaway processes ... for a scheduled cron shutdown drop the -9 ... just kill or pkill should be good.

mewantsbitcoins
Full Member
***
Offline Offline

Activity: 126


View Profile
May 06, 2011, 07:57:32 PM
 #16

Hi all. Thanks for your replies. I am running jgarzik's miner on CentOS and here's how I did it:

Code:
crontab -e

Code:
00 21 * * * /[path to your miner]/minerd -t 2 -a cryptopp_asm32 --url [url of your pool] --userpass [username]:[password] &
00 09 * * * pkill minerd

This starts miner everyday at 21:00 and stops it at 09:00
Grinder
Legendary
*
Offline Offline

Activity: 1269


View Profile
May 06, 2011, 09:06:50 PM
 #17

so on a dedicated mining rig without other python called processes running "$pkill -9 python" would work fine from cron. I've always wondered what the difference is between using the python prefix command or just the $./process.py ... doesn't seem to make a difference to hashrate but who knows ...
The only difference is that if you do python <file> the shell will execute python which then loads and runs <file>. If you run ./<file> the shell will read <file>, see the starting #! characters (pronounced shebang) and then execute the program in the first line of it (often /usr/bin/python) with <file> as parameter.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!