Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Linux Script - New TMUX session start miner at reboot
#1
Code:
#!/bin/bash
sleep 30
tmux new-session -s nh -d
sleep 2
tmux send-keys -t nh 'export GPU_SYNC_OBJECTS=1' 'Enter'
sleep 2
tmux send-keys -t nh 'export GPU_FORCE_64BIT_PTR=1' 'Enter'
sleep 2
tmux send-keys -t nh 'cd ~/optiminer' 'Enter'
sleep 2
tmux send-keys -t nh './optiminer-zcash -i 4 -s equihash.usa.nicehash.com:3357-u 1hTQRoaw9CDkow29QQYGBotWGcVtnK28G -p x' 'Enter'
Lets save the file as "mine.sh" and make it executable
Code:
sudo chmod +x mine.sh
I use ubuntu desktop so I usually add it to start-up programs, but if you use server you can add it to your crontab file.

Code:
sudo crontab -e
at the bottom without comments in front add "@reboot /home/USER/PATH/mine.sh" just don't forget to change the USER and PATH to where ever you have your miner binaries. Save the new crontab and try it out by typing in command line,
Code:
sudo shutdown -r now
Now when your rig boots, your miner will start in a new TMUX session that you can SSH into your system to check your sessions by typing,

Code:
tmux a -t nh
"nh" is what I named the session due to me using NiceHash stratum, but you can change the "nh" to whatever fits your needs.
Reply


Bookmarks

Forum Jump:


Users browsing this thread: 1 Guest(s)
Expand chat