Seti shell script

Status
Not open for further replies.

greatoz

Ars Tribunus Militum
2,847
Subscriptor++
My skills are sadly lacking - I haven't the right sort of brain to program. Here's what I found on the Forum thus far:

code:<HR>
Code:
<B>#!/bin/sh
#
while [ 0 = 0 ]; do
cd /seti
seti -stop_after_process
if [ $? = 1073741510 ]; then
break
fi
done
[/B]

I then modified this line thusly:

code:<HR>
Code:
<B>seti -stop_after_process > /dev/null &
[/B]

in an effort to redirect output to /dev/null and run it in the "background" but it doesn't work. Here's the output:

code:<HR>
Code:
<B>[xxxx@XXX /seti]# ./seti.sh
SETI@home client.
Platform: i386-pc-linux-gnu-gnulibc2.1
Version: 3.0<P>SETI@home is sponsored by individual donors around the world.
If you'd like to contribute to the project,
please visit the SETI@home web site at
<A HREF="http://setiathome.ssl.berkeley.edu" TARGET="_blank">http://setiathome.ssl.berkeley.edu</A>.
The project is also sponsored by the Planetary Society,
the University of California, Sun Microsystems, Paramount Pictures,
Fujifilm Computer Products, Informix, Engineering Design Team Inc,
The Santa Cruz Operation (SCO), Intel, Quantum Corporation,
and the SETI Institute.<P>SETI@home was developed by David Gedye (Founder),
David Anderson (Director), Dan Werthimer (Chief Scientist),
Leonard Chung, Hiram Clawson, Jeff Cobb, Charles Congdon, Charlie Fenton,
Kyle Granger, Eric Heien, Mike Hill, Michael Kang, Eric Korpela,
Matt Lebofsky, Peter Leiser, Brad Silen, Woody Sullivan, and Adam Wight.<P>Scanning data file
Data Info:
Sky coordinates: 19.196 R.A., 18.620 Dec
Recorded on:  2451766.56949 (Thu Aug 10 01:40:03 2000)
Source: Arecibo Radio Observatory
Base Frequency: 1.418759766 GHz
Found data file: yes. Found result header file: yes.
Scanning result header file.
Beginning analysis...
Doing baseline smoothing.
Starting work for Doppler shift rate 0.000000, FFT length 32
1.223221% done
... Searching for Pulses<P>[1]+  Terminated              ./seti >/dev/null
[/B]

It DOES work if I type: ./seti.sh > /dev/null &, but that just isn't elegant...BTW, this WILL process a WU, send it up, and get me another to chew on, yes???

Please HELP me!!! :D </groveling>

greatoz

[This message was edited by greatoz on November 18, 2000 at 00:31.]
 
D

Deleted member 12245

Guest
First:
seti -stop_after_process > /dev/null &

Putting that in a while loop will spawn as many copies of seti as you have ram. Remove the '&' because you don't want this in the background, you want the script.

Second:
I don't know why the > /dev/null didn't work. It should have afaik. I dont have seti on my linux box, so I can't tell if seti does really bad stuff with the output (though theoretically anything you do would go to /dev/null). Just to make sure I wasn't missing anything, I whipped up a script that just ran 'banner' and dumped it into devnull like you were doing and it worked just as it should. So...I don't know why that isn't working.

Third:
if [ $? = 1073741510 ]; then
break
fi

What is that supposed to do?

I really don't know why you would need a script does this, iirc seti does it on its own just fine (though the last time I ran seti was on a 486 about a year ago).
 

greatoz

Ars Tribunus Militum
2,847
Subscriptor++
that's part of the problem - I haven't the foggiest of what ANY of it does.

I can tell you this, the script spawns ONE set process, and I HOPE it sends results, gets another WU, and keeps on truckin'.

./seti -verbose > /dev/null & @ the command line does do what I want, but dies when the WU is finished.

Perhaps what I need is a script that'll just do that, spawn a seti process, get a WU, chew on it, send the result, and get another WU to chew on, all in the SAME process, in a never-ending loop. Any takers???

greatoz
 
#!/bin/sh
# Assume seti program is in directory /seti
# and a copy of user_info.sah is in ../first,
# ../second, etc.
while [ 0 = 0 ]; do
cd /seti/first
../seti -stop_after_process > /dev/null 2> /dev/null
../seti -stop_after_xfer > /dev/null 2> /dev/null
cd /seti/second
../seti -stop_after_process > /dev/null 2> /dev/null
../seti -stop_after_xfer > /dev/null 2> /dev/null
sleep 120
done

You can add a /seti/third if you want to buffer 3 WUs at at time.

I'm not a big script expert either, but if the while / do /done syntax is correct, the rest ought to work.

And, don't worry about the ../ type notation being "inelegant." Worry about getting it to work. No one cares too much how pretty a working script is.

The sleep 120 at the end is optional, but it keeps your machine from going too crazy if there is a SETI outage and you end up finishing all your WUs before you can connect successfully. Losing 2 minutes per 2 WUs is not a significant penalty, statistically, but if it bothers you, take it out.

Keep in mind that you may need ksh or (on Linux) bash to get the 2> /dev/null part to work. If it doesn't work on your shell, take that part out.
 

CaptChaos

Smack-Fu Master, in training
98
Um, I think you want this:

nohup ./setiathome > /dev/null &

This will put SETI in the background and allow you to log out and continue running. This process will run forever unless there is a problem with the SETI servers or your network.

If you want to be able to automatically restart SETI if it has died, you can put the following in your crontab.

0 * * * * cd /your/path; ./setiathome > /dev/null 2> /dev/null

This will try to restart SETI every hour on the hour.

You can use 'ps -ef |grep seti' to check to make sure the SETI process is actually running.

Hope this helps
 
Status
Not open for further replies.