mewantsbitcoins (OP)
|
|
May 05, 2011, 02:00:26 PM |
|
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.
|
|
|
|
Dayofswords
Member
Offline
Activity: 138
Merit: 11
Exchange BTC in Telegram https://bit.ly/2MEfiw8
|
|
May 05, 2011, 09:00:10 PM |
|
or if on windows, the task scheduler that no one uses these days
(i need to learn cron...)
|
|
|
|
grndzero
|
|
May 05, 2011, 09:31:42 PM |
|
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
|
|
May 05, 2011, 09:54:14 PM |
|
On linux, use cron with for poclbm or for pheonix
|
|
|
|
grndzero
|
|
May 05, 2011, 10:10:05 PM |
|
On linux, use cron with for poclbm or 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
|
|
May 05, 2011, 10:25:36 PM |
|
Grndzero, you are correct that pkill could interfere with other processes. My mining systems are dedicated and there are no other processes named "python".
|
|
|
|
grndzero
|
|
May 05, 2011, 10:33:02 PM |
|
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
Activity: 78
Merit: 10
|
|
May 05, 2011, 10:47:58 PM |
|
Yes i would also be interested in this perhaps a windows option?
|
|
|
|
|
[Tycho]
|
|
May 05, 2011, 11:32:56 PM |
|
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
|
|
May 05, 2011, 11:39:15 PM |
|
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
|
|
May 05, 2011, 11:40:27 PM |
|
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#msg94337It 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
Activity: 3920
Merit: 2349
Eadem mutata resurgo
|
|
May 05, 2011, 11:50:13 PM |
|
On linux, use cron with for poclbm or 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
|
|
May 06, 2011, 08:00:14 AM |
|
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
Activity: 3920
Merit: 2349
Eadem mutata resurgo
|
|
May 06, 2011, 11:20:39 AM |
|
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 (OP)
|
|
May 06, 2011, 07:57:32 PM |
|
Hi all. Thanks for your replies. I am running jgarzik's miner on CentOS and here's how I did it: 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
Activity: 1284
Merit: 1001
|
|
May 06, 2011, 09:06:50 PM |
|
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.
|
|
|
|
|