Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-05-2018, 07:57 PM   #1
LQ Newbie
Registered: Jan 2018
Posts: 1

Rep: Reputation: Disabled
Smile Help with a simple (for you) script


I am pretty new to Linux, because I am now mining crypto's. Running Ubuntu 16.04 LTS.

Would like to create a simple script that will do the following when started from within a terminal:

cd /usr/local/claymore10.2/
(run a timer for 12 hours and then...)
Ctrl+C (to cancel the ETH miner)
cd /usr/local/cryptonote10.2/
(run a timer for 12 hours and then...)
Ctrl+C (to cancel the ETN miner)
(and then loop)

At least I think this is the way to approach this. Clearly my goal here is to have my mining rig switch between the ETH miner and the ETN miner every 12 hours without any involvement from me.

I built the rig myself and it's going pretty well, but I don't even know where to start with this next little phase of the project. I could probably spend many hours learning and reading how to do this, but instead here is a chance for someone to show off their Linux-scripting prowess and save me a lot of time!

Thanks in advance for your help!
Old 01-05-2018, 09:25 PM   #2
LQ Guru
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: FreeBSD/Slackware-14.2+/ArcoLinux
Posts: 9,082

Rep: Reputation: 1903Reputation: 1903Reputation: 1903Reputation: 1903Reputation: 1903Reputation: 1903Reputation: 1903Reputation: 1903Reputation: 1903Reputation: 1903Reputation: 1903
something like this, you'll have to weed out my test file names and add yours then test it
file name of this script


while [ true ] 

#/usr/local/claymore10.2/ &


# Wait x amount of time  ( seconds here) 
sleep 2

pkill -u $USER -o echobash

#(run a timer for 12 hours and then...)

#Ctrl+C (to cancel the ETH miner)
#cd /usr/local/cryptonote10.2/
##(run a timer for 12 hours and then...)
#Ctrl+C (to cancel the ETN miner)
#(and then loop)

test script to run then kill then run then kill ...

echo " running ...."
userx@solus ~ $ ./
 running ....
 running ....
 running ....
 running ....
if you only want the main control script to run x amount of times.


while [ $count -lt 5 ] 

~/echobash &
sleep 2

pkill -u $USER -o echobash
# repeat steps for a different script

#keep count

runs five times then quits

Last edited by BW-userx; 01-05-2018 at 09:39 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Need help getting started simple simple shell script dhonnoll78 Programming 6 12-17-2007 05:34 PM
Simple script to wait for another script Maverick1182 Linux - Newbie 4 11-05-2007 03:45 AM
Iptables (with masq) troubleshooting, very simple script attached script and logs. xinu Linux - Networking 13 11-01-2007 04:19 AM
Need help with a simple script shell script WindowBreaker Linux - Software 2 12-15-2005 12:45 PM
Simple C Shell script is not so simple elconde Programming 2 09-16-2001 11:53 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:46 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration