Bash:
#!/bin/bash
t[10]=0 t[11]=0 t[12]=0 t[13]=0
t[20]=0 t[21]=0 t[22]=0 t[23]=0
while read line
do
case ${line} in
"project URL: "* )
case ${line#*"project URL: "} in
"https://boinc.bakerlab.org/rosetta/" ) p=10;;
"https://universeathome.pl/universe/" ) p=20;;
esac
;;
"state: "* )
case ${line#*"state: "} in
"downloading" ) ((t[p+0]++));;
"downloaded" ) ((t[p+1]++));;
"uploading" ) ((t[p+2]++));;
"uploaded" ) ((t[p+3]++));;
esac
;;
esac
done <<< $(boinccmd $@ --get_tasks)
printf " downloading downloaded uploading uploaded\n-------------------------------------------------\n"
printf "Rosetta %7d %7d %7d %7d\n" ${t[10]} ${t[11]} ${t[12]} ${t[13]}
printf "Universe %7d %7d %7d %7d\n" ${t[20]} ${t[21]} ${t[22]} ${t[23]}
Note, replace https by http in the Rosetta URL if you still use the previous URL.
Say, you stored it under the name "count.sh" and made it executable.
You can then look at the main client on the localhost by this invocation:
./count.sh
The output will look like this:
Code:
downloading downloaded uploading uploaded
-------------------------------------------------
Rosetta 0 8 0 0
Universe 0 0 0 0
(This is from my desktop computer which is currently working on Rosetta only. "Downloaded" tasks includes ready to run, running, and suspended tasks. "Uploaded" tasks means tasks ready to report. "Downloading" and "uploading" are being transferred, or in a stuck transfer waiting for retry.)
To check out a secondary instance on localhost:
./count.sh --host localhost:31422
And a remote host called "bigiron" and protected by the password "abc123":
./count.sh --host bigiron:31422 --passwd "abc123"
To monitor the primary local client continuously in 120-seconds intervals:
watch -n 120 ./count.sh