Title: Simple shell script for starting my miners - linux? Post by: Bitcoin Swami on June 27, 2011, 08:39:28 PM Hey guys I'm just learning scripting a bit, anyone got just a simple script to start my poclbm miners.
I made one to start my AMD Overdrive Control, but I don't think I know the right syntax to make this other kind. I know its only a couple lines.. Just a file to click on my desktop to restart in case my comp freezes or something. Thanks Mike Title: Re: Simple shell script for starting my miners - linux? Post by: Rob P. on June 28, 2011, 01:06:07 AM This is what I use:
Code: #!/bin/sh To use: Code: ./startworker.sh 0 Where 0 is replaced in the script for ${1}. That will use the following parameters: Worker: username.0 Password: 4910 Device: 0 So, if you build your workers with usernames and passwords ending in a digit paired with the device number, then you can fire up 3 miners on 3 GPUs using: Code: /usr/bin/screen -dmS gpu0 ./startworker.sh 0 Then access those miners using: Code: screen -r gpu0 Use CNTL-A, D to detach and leave it running. Title: Re: Simple shell script for starting my miners - linux? Post by: antares on June 28, 2011, 01:30:38 AM here's something I made for it. I have to control about 320 Workers(160 Machines, GPU + CPU miners, all miners need different user/pw with my pool):
I therefore use a live usb drive that just copies itself into ram(so I can remove the thumb drive) and gets everything started automatically. Here's the init script /etc/init.d/miner: Quote #!/bin/sh case "$1" in start) if [ -f /tmp/miner.lock ] then echo miner already running! exit fi touch /tmp/miner.lock echo "power will be down in 10 hours" echo "starting gpu miner btw" /sbin/ifconfig eth0 up /sbin/dhclient -v eth0 sleep 5 export user=$(wget -qO - 'http://my-domain.info/workers/getdata.php?user&worker=cpu') export guser=$(wget -qO - 'http://my-domain.info/workers/getdata.php?user&worker=gpu') export pass=$(wget -qO - 'http://my-domain.info/workers/getdata.php?pass&worker=cpu') export gpass=$(wget -qO - 'http://my-domain.info/workers/getdata.php?pass&worker=gpu') /usr/bin/power.sh & /usr/bin/ul386 & cd /usr/bin ./itech -o http://bitcoins.lc:8080 -u $user -p $pass -t 4 & ./rpcminer -url=http://bitcoins.lc:8080/ -user=$guser -password=$gpass -aggression=14 -workrefreshms=15000 & ;; stop) echo "does nothing" ;; *) echo "only does start" exit 1 ;; esac exit 0 what it does... it first tests if another startup has been done before. If so, exits. then it sets up networking to get an internet connectoin. after that, it will request user and password from a web interface. All my miner credentials are stored in a database and assigned by ip, as my hosts are having static ip's towards the internet. after getting the credentials, the poweroff daemon is started. I'll get to that later. ul386 is actually nothing to worry about, its just another project of mine. Well, now comes the juicy part: launch ufasoft miner on all cpu cores(itech = ufasoft cpu miner), send to background. After that, it will start rpcminer(CUDA miner, the cards in my machines are nvidia). now the power script /usr/bin/power.sh: Quote #!/bin/bash # export xtime=$(wget -qO - http://my-domain.info/workers/getst.php) while [ "$(date +%H:%M)" != "$(wget -qO - http://my-domain.info/workers/getst.php)" ] do sleep 5 done echo "shutting down!" shutdown -hH now this one is pretty nice. the getst.php script will contain a time in date +%H:%M format, and until this time is reached, it will do nothing. after that it shuts down the machines. I do that because the room where those machines are in gets pretty heated, so I usually shutdown all the machines 2 hrs before they are used again(they power up automagically) for the air condition to cool down the room. Also I can set the time getst returns remotely. All of this is packed into a 320MB Live-Thumbdrive, and it has an option to boot from cdrom, as a few of my machines refuse to boot from usb. All in all, it's just plugging in, letting it boot, remove thumbdrive, go away. I could also upload the thing if anyone's interested ( donations are also always welcome ) Title: Re: Simple shell script for starting my miners - linux? Post by: Bitcoin Swami on June 28, 2011, 03:01:36 AM Wow thanks buds!
Title: Re: Simple shell script for starting my miners - linux? Post by: jondecker76 on June 28, 2011, 09:43:10 AM I have a nice set of scripts for maintaining linux miners (starting up, shutting down, creating profiles, running multiple instances, etc) and I'm still looking for more beta testers
You should give it a try http://forum.bitcoin.org/index.php?topic=16548.0 Title: Re: Simple shell script for starting my miners - linux? Post by: Rob P. on June 28, 2011, 11:34:37 AM I have a nice set of scripts for maintaining linux miners (starting up, shutting down, creating profiles, running multiple instances, etc) and I'm still looking for more beta testers You should give it a try http://forum.bitcoin.org/index.php?topic=16548.0 +1 for SmartCoin as well. Nice work by a member of the forums. Beta 2 is looking great. |