| Index | Recent Threads | Unanswered Threads | Who's Active | Guidelines | Search |
| World Community Grid Forums
|
| No member browsing this thread |
|
Thread Status: Active Total posts in this thread: 13
|
|
| Author |
|
|
VinceLewis
Cruncher Joined: May 13, 2020 Post Count: 7 Status: Offline |
Okay so my server is an HP proliant DL385 and does not allow for suspend or hibernate. I'm running ubuntu on it.
So I went away and wrote a small bash script to run in the evening to wait for the ARP unit to go past the next checkpoint, then poweroff. Here's my script if it helps anyone. Note that I currently only allow for 1 ARP unit at a time, so the script would need an update to cater for more than 1. #!/bin/bash # find the africa rainfall project. It checkpoints every 12.5%. Need to ensure we don't can it before it's checkpointed a=`boinccmd --get_tasks | grep "name: ARP" -A15 | grep "active_task_state: EXECUTING" -A9 | grep "CPU time at last checkpoint: " | grep -Eo '[+-]?[0-9]+([.][0-9]+)?'` if [ -z "$a"] then echo "No africa rainforest project running, powering off now" /sbin/poweroff exit 0 fi echo "Original checkpoint time at $a seconds. Waiting for that to change indicating a new checkpoint" b=`boinccmd --get_tasks | grep "name: ARP" -A15 | grep "active_task_state: EXECUTING" -A9 | grep "CPU time at last checkpoint: " | grep -Eo '[+-]?[0-9]+([.][0-9]+)?'` until [ 0 -eq "$(echo "${b} == ${a}" | bc)" ] do sleep 120 b=`boinccmd --get_tasks | grep "name: ARP" -A15 | grep "active_task_state: EXECUTING" -A9 | grep "CPU time at last checkpoint: " | grep -Eo '[+-]?[0-9]+([.][0-9]+)?'` done echo "New checkpoint at $b seconds, all done :-)" /sbin/poweroff |
||
|
|
adriverhoef
Master Cruncher The Netherlands Joined: Apr 3, 2009 Post Count: 2346 Status: Offline Project Badges:
|
Yes, great script, VinceLewis;
----------------------------------------another approach would be to look at the latest checkpoint using 'wcgresults': until wcgresults -HNLr | grep '^ 0:0[012]:[0-5][0-9].ARP1_' && echo poweroff; do sleep 120; done (If the latest checkpoint was within 3 minutes ago (allowing for a few seconds overshooting 120 seconds), power off.) (Remove 'echo' to get the real experience.) Also, if you want to check if any ARP1 is already running before you enter the main loop, you could use this little thingy: wcgresults -HNr | grep ^ARP1 || echo poweroff (Remove 'echo' to get the real experience.) ![]() [Edit 3 times, last edit by adriverhoef at Dec 2, 2020 3:05:45 PM] |
||
|
|
VinceLewis
Cruncher Joined: May 13, 2020 Post Count: 7 Status: Offline |
got to love a 1 line script.
My comedy moment today - not had any ARP work units for the day ![]() |
||
|
|
|