mersenneforum.org  

Go Back   mersenneforum.org > Great Internet Mersenne Prime Search > Hardware > GPU Computing > GpuOwl

Reply
 
Thread Tools
Old 2020-01-03, 20:45   #12
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

11101011001102 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
If you can hack this not-so-great code...

Code:
if (( $(date +%s) > $(stat -c %Y -- examplefile.txt ) + 3600 )); then killall gpuowl; echo "hi" ;  fi;
I've got the gpuowl.log-not-being-updated part working (see below). Thanks.

Code:
if (( $(date +%s) > $(stat -c %Y -- /home/george/gpuowl1/gpuowl.log) + 3600 ||
      $(date +%s) > $(stat -c %Y -- /home/george/gpuowl2/gpuowl.log) + 3600 ||
      $(date +%s) > $(stat -c %Y -- /home/george/gpuowl3/gpuowl.log) + 3600));
then
  killall gpuowl;
  sleep 30
# /root/gpu-settings
# /root/gpu-settings1
# /root/gpu-settings2
  screen -S owl1 /home/george/gpuowl1/gpuowl -dir /home/george/gpuowl1
  screen -S owl2 /home/george/gpuowl2/gpuowl -dir /home/george/gpuowl2
  screen -S owl3 /home/george/gpuowl3/gpuowl -dir /home/george/gpuowl3
fi;
Is there a preferred way to run a sudo command from this script? I'd like to add this line to my crontab script "sudo /root/gpu-settings" without asking for a password.

Last fiddled with by Prime95 on 2020-01-03 at 20:46
Prime95 is offline   Reply With Quote
Old 2020-01-03, 22:06   #13
paulunderwood
 
paulunderwood's Avatar
 
Sep 2002
Database er0rr

3,739 Posts
Default

Quote:
Originally Posted by Prime95 View Post
I've got the gpuowl.log-not-being-updated part working (see below). Thanks.

Code:
if (( $(date +%s) > $(stat -c %Y -- /home/george/gpuowl1/gpuowl.log) + 3600 ||
      $(date +%s) > $(stat -c %Y -- /home/george/gpuowl2/gpuowl.log) + 3600 ||
      $(date +%s) > $(stat -c %Y -- /home/george/gpuowl3/gpuowl.log) + 3600));
then
  killall gpuowl;
  sleep 30
# /root/gpu-settings
# /root/gpu-settings1
# /root/gpu-settings2
  screen -S owl1 /home/george/gpuowl1/gpuowl -dir /home/george/gpuowl1
  screen -S owl2 /home/george/gpuowl2/gpuowl -dir /home/george/gpuowl2
  screen -S owl3 /home/george/gpuowl3/gpuowl -dir /home/george/gpuowl3
fi;
Is there a preferred way to run a sudo command from this script? I'd like to add this line to my crontab script "sudo /root/gpu-settings" without asking for a password.
You could do this:

Code:
echo "password" | sudo -S /root/gpu-settings
For security reasons you should use root's crontab
paulunderwood is online now   Reply With Quote
Old 2020-01-03, 22:44   #14
Prime95
P90 years forever!
 
Prime95's Avatar
 
Aug 2002
Yeehaw, FL

2×53×71 Posts
Default

Quote:
Originally Posted by paulunderwood View Post
You could do this:

Code:
echo "password" | sudo -S /root/gpu-settings
For security reasons you should use root's crontab
It's a standalone machine in my house, so security isn't a real big concern.

I was unable to get root crontab to work with "@reboot". However, you are correct that this would be handled by root's crontab since it is not a @reboot item.

Thanks for the help.
Prime95 is offline   Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
gpuOWL for Wagstaff GP2 GpuOwl 22 2020-06-13 16:57
gpuowl tuning M344587487 GpuOwl 14 2018-12-29 08:11
Possibly stupid question about porting games to Linux. jasong Linux 4 2006-12-23 21:24
a simple question on the Linux client nngs Software 1 2005-11-27 01:39
linux question ( newb) crash893 Software 2 2003-12-26 18:50

All times are UTC. The time now is 02:40.


Sat Jul 17 02:40:26 UTC 2021 up 50 days, 27 mins, 1 user, load averages: 1.49, 1.55, 1.48

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2021, Jelsoft Enterprises Ltd.

This forum has received and complied with 0 (zero) government requests for information.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation.
A copy of the license is included in the FAQ.