export DISPLAY=`cat /home/user/.display`
pc=`ps waxuf | grep miner1.sh -c`
ld=`aticonfig --odgc --adapter=0 | grep "GPU load" | cut -c 30-35 | cut -d % -f 1`
if [ $pc -lt "2" ] || [ $ld -lt "50" ] ; then
kill `ps -ef | grep miner1 | grep -v grep | awk '{print $2}'`
lxterminal --title miner1 --command sh /home/user/miner1.sh &
date +"%D %r miner1 restarted" >> /home/user/cron_job.log
fi
pc=`ps waxuf | grep miner2.sh -c`
ld=`aticonfig --odgc --adapter=1 | grep "GPU load" | cut -c 30-35 | cut -d % -f 1`
if [ $pc -lt "2" ] || [ $ld -lt "50" ] ; then
kill `ps -ef | grep miner2 | grep -v grep | awk '{print $2}'`
lxterminal --title miner2 --command sh /home/user/miner2.sh &
date +"%D %r miner2 restarted" >> /home/user/cron_job.log
fi
pc=`ps waxuf | grep miner3.sh -c`
ld=`aticonfig --odgc --adapter=2 | grep "GPU load" | cut -c 30-35 | cut -d % -f 1`
if [ $pc -lt "2" ] || [ $ld -lt "50" ] ; then
kill `ps -ef | grep miner3 | grep -v grep | awk '{print $2}'`
lxterminal --title miner3 --command sh /home/user/miner3.sh &
date +"%D %r miner3 restarted" >> /home/user/cron_job.log
fi
with the following errors
aticonfig: This program must be run as root when no X server is active
kill: 9: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
/home/user/restart.sh: 9: cannot create /home/user/cron_job.log: Permission denied
(lxterminal:3517): Gtk-WARNING **: cannot open display:
aticonfig: This program must be run as root when no X server is active
[: 16: -lt: unexpected operator
aticonfig: This program must be run as root when no X server is active
[: 23: -lt: unexpected operator
and in root
kill: 9: Usage: kill [-s sigspec | -signum | -sigspec] [pid | job]... or
kill -l [exitstatus]
(lxterminal:3594): Gtk-WARNING **: cannot open display:
[: 16: -lt: unexpected operator
[: 23: -lt: unexpected operator