-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDOC.txt
More file actions
66 lines (42 loc) · 1.46 KB
/
DOC.txt
File metadata and controls
66 lines (42 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
I have made the following scripts because my miner crash after few hours/days.
If something wrong with the miner, then kill and reboot:
vim /home/yourusername/optiminer-zcash/watchdog-cmd.sh
echo "Uncomment any of the actions in 'watchdog-cmd.sh' to perform on stuck GPU!"
#========Start=======
#Kill if somthing wrong
PID=`ps -eaf | grep optiminer | grep -v grep | awk '{print $2}'`
if [[ "" != "$PID" ]]; then
echo "killing $PID"
kill -9 $PID
fi
## Reboot:
/sbin/shutdown -r now
#=======END=========
This script will start the miner in a tmux session if not running:
chmod +x /home/yourusername/optiminer-zcash/watchdog-cmd.sh
Create script startminer.sh with the following content :
touch /home/yourusername/startminer.sh
vim /home/yourusername/startminer.sh
======START=======
#!/bin/bash
# Check fi running
ps auxw | grep optiminer | grep -v grep > /dev/null
if [ $? != 0 ]
#if not, then start
then
/usr/bin/tmux new-session -d /home/cristian/optiminer-zcash/mine.sh
fi
#end
=======END========
This cron job will execute the startminer.sh on every 5 minute
chmod +x /home/yourusername/startminer.sh
Add the following job in crontab
*/5 * * * * /bin/sh /home/youusername/startminer.sh
In order to check your miner just exectue the following command :
See tmux sessions :
# tmux list-sessions
Attach to the session
# tmux a
Detach from session
ctrl+b c
I hope this will help some miners.