News:

Members can see all forum boards and posts. Non members can only see a few boards.  If you have forgotten your password use this link to change it.
https://forum.boinc-australia.net/index.php?action=reminder

Main Menu

Yoda Help with your Cron script

Started by Dingo, February 23, 2009, 05:37:11 AM

Previous topic - Next topic

Dingo

Yoda,

Now that I have the majority of my crunchers on command line Ubuntu I thought that I would give your script a go as I see that some run out of work and sit idle for a while till milkyway gets more work.  I kept your script below but I get an "Authorization failure -155" error on all the nodes except the local one.

Any Ideas ?   The password that I use is the password that is in gui_rpc_auth.cfg and is the same password that I use to log into the PC's.  I tried to search but didn't find anything useful.

Thanks

# Script to refresh Milkyway - typically used in a cron job
# Written by Webmaster Yoda (Bert Doorn) of BOINC@AUSTRALIA

myNodes="QUAD2 QUAD3 QUAD4 QUAD5"
myPasswd=whatever
myProject=http://milkyway.cs.rpi.edu/milkyway/

# localhost first - no need for password and hostname
/usr/bin/boinc_cmd --project $myProject update

# Now the rest of the farm
for node in $myNodes
do
  /usr/bin/boinc_cmd --host $node --passwd $myPasswd --project $myProject update
done
---------------------------------------------------------------------------------------------------------------------------
My cron job looks like this:  0,10,20,30,40,50 * * * *  /home/username/updatemw

------------------------------------------------------------------------------------------------------------------------------


Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA

yoda

Sorry, missed this post.  I now have the same problem Veebee had some time ago in that "show unread posts" isn't working properly.  May be something to do with me having logged out and back in.




Anyway...   I don't see any obvious reason why it isn't working, if you have set the first 3 variables to reflect your setup (i.e. the node names or IPs, password and project to update)

You could try putting the password and project in quotes, i.e.
myPasswd = "WhatEverYourPasswordIs"
myProject = "http://milkyway.cs.rpi.edu/milkyway/"

The PC running the script does of course need to be included in the remote_hosts.cfg file on the other PC's or they won't allow it in..

Dingo



I will have to remember next weekend when I am back at home.  I think I will change the host names to IP addresses as that may be the problem, and the quotes as well.

Thanks


Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA

Mike Mitchell

G'day Dingo,
I had the same problem with my Kubuntu box and fixed by cd'ing to the working directory /var/lib/boinc-client in my case, and that worked a treat. I haven't tried absolout paths but I would have thought that would have worked the same. But it doesn't. Must have someting to do with the way the commands execute (probably) locally.

You could try adding /var/lib/boinc-client to $PATH
AA's > 1-Malaria 2-Tanpaku 3-Riesl Siev 4-Seti 5-ABC 6-Einstein 7-WCG 8-Seti 9-QMC 10-WCG 11-Cosmo 12-ABC 13-MilkyWay 14-3x+1 15-Rosetta 16-ABC 17-MilkyWay 18-Einstein 19-WCG 20-WCG 21-Poem 22-Rosetta 23-Docking 24-Spinhenge 25-Alternate 26-Simap 27-Alternate 28-Constellation 29-WCG 30-Edges 31-Alternate 32-Pogs 33-WCG 34-Seti 35-Pogs 36-Poem 37-Pogs 38-Asteroids 39-Pogs 40-Simap 41-Pogs 42-Seti


WikiWill

I found the same. It appears boinc_cmd expects to be run only from the BOINC directory and reads/writes other files by referencing the current working directory, so adding to the $PATH variable doesn't help.

Dingo

OK I give up I can't get it to work.  Can't even run the command on the command line and get a authorization error on the local host.  :furious:

I have other projects attached to most of my PC's now so it won't run out of work.



Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA

Dingo

OK, I am trying again. In the Milkyway forum there re posts on scripts but just for MS.  I have put ina post to see if there is a way to send a command from a MS bat file to Linux ??   If anyone knows please let me know.

  http://milkyway.cs.rpi.edu/milkyway/forum_thread.php?id=714&nowrap=true#15496

If there is a way to pass it from XP I will be doing the  :dance2: beause to get the cron script to work I have to get all the pc's one at a time hooked up to a monitor keyboard etc.  Just too much trouble for now.



Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA

Mike Mitchell

If all the Linux boxes have network access, then you could install a cron job for each box on one Linux computer ( a defacto server)
AA's > 1-Malaria 2-Tanpaku 3-Riesl Siev 4-Seti 5-ABC 6-Einstein 7-WCG 8-Seti 9-QMC 10-WCG 11-Cosmo 12-ABC 13-MilkyWay 14-3x+1 15-Rosetta 16-ABC 17-MilkyWay 18-Einstein 19-WCG 20-WCG 21-Poem 22-Rosetta 23-Docking 24-Spinhenge 25-Alternate 26-Simap 27-Alternate 28-Constellation 29-WCG 30-Edges 31-Alternate 32-Pogs 33-WCG 34-Seti 35-Pogs 36-Poem 37-Pogs 38-Asteroids 39-Pogs 40-Simap 41-Pogs 42-Seti


yoda

Yes, that's how my script works (on Ubuntu).  But it's not working for Dingo for some reason.



# Script to update a project - typically used in a cron job
# Written by Webmaster Yoda of BOINC@AUSTRALIA

# This version:
#  uses IP Addresses to access the nodes
#  takes the project URL as paramater

myNetwork="192.168.0"
myNodes="101 102 103 201 202 203 204 205"
myPasswd="whatever"

if [ -z $1 ] # No URL provided!
then
  echo Please provide the Project URL as a command-line argument
  echo e.g. update.sh http://abcathome.com/
elif [ -n $1 ]
then
# use first parameter for project URL
  myProject=$1

# localhost first
  /usr/bin/boinc_cmd --project $myProject update

  # Now the rest of the farm
  for node in $myNodes
  do
    /usr/bin/boinc_cmd --host $myNetwork.$node --passwd $myPasswd --project $myProject update
  done
fi
# All done!



WikiWill

Quote from: Dingo on March 16, 2009, 04:46:16 AM
I have put ina post to see if there is a way to send a command from a MS bat file to Linux ??   If anyone knows please let me know.
  http://milkyway.cs.rpi.edu/milkyway/forum_thread.php?id=714&nowrap=true#15496

Dingo, you could do this with a 3rd party utility like Putty (http://www.chiark.greenend.org.uk/~sgtatham/putty/) which allows ssh from Windows to Linux.  The Putty download/install package includes a command called plink which you can use in batch files to do something like:

    plink root@myserver /BOINC/boinc_cmd http:... update

or

    plink root@myserver /usr/local/run-my-boinc-script.sh

You may want to use public/private keys for authentication as this is much nicer than hard-coded passwords in scripts.  This is pretty easy to do.  Let me know if you need detailed steps.  On the Windows side, you generate a key pair using the puttygen.exe utility (run it then clicking on Generate button, then save the private and public keys in files).  Then you configure ssh on Linux to use the public key you just generated.

This might be what you're looking for.  I know no easy way to do it natively from Windows!

Dingo

Thanks for the replies. I will have a look next weekend at putty when I get back home.


Radioactive@home graph
Have a look at the BOINC@AUSTRALIA Facebook Page and join and also the Twitter Page.

Proud Founder and member of BOINC@AUSTRALIA

My Luck Prime 1,056,356 digits.
Have a look at my  Web Cam of Parliament House Ottawa, CANADA