It's really not that important .. I now run ./perlgo & which runs my
perl script that sleeps for 60 seconds and then runs a shell script that runs
lynx and ncftpput to update the page (it does what ?):
http://members.optushome.com.au/kozer/
(check it out, it has the time there too, heh)
I mentioned the code for this before but I can send it to anyone that wants it
Because my connection is fast and fortune/ncftpput only take half a second
things work out just great. I could of course add all these system stats such
as uptimes/memory etc but I reakon that's pushing it (my uptimes suck anyway
cause I need Windows every so often)
Thanks anyway ! It looks like you've read thru a shell scriping book or
something ?! GEE ! : )
Regards, Matt
On Thu, 06 Jul 2000, you wrote: > That'll execute code and
sleep for 60 seconds every time. Supposing it > takes 10 seconds for your
program to do its funky thang, that's 70 seconds > for each run. The fork
doesn't seem to be too helpful in this one, you > might as well just
background when you execute the script :) If you wanted > to get into some of
that funky forking action you could try something like; > > $SIG{CHLD} =
'IGNORE'; > while(!$finished) {
> sleep(60);
> if(!defined($pid=fork())) {
> die "Cannot fork: $!\n";
> } elsif(!$pid) {
> $finished=1;
> # do whatever it is you want
> }
> }
>
> Every 60 seconds you get an extra process which performs your task once,
> and then dies. The original will stay attached to your shell the whole while.
>
> Alexander.
>
>
> > > On Thu, 06 Jul 2000, you wrote:
> > > > #!/usr/bin/perl
> > > >
> > > > fork(&myprog) && die;
> > > >
> > > > sub myprog {
> > > >
> > > > while (1 = 1) {
> > > >
> > > > ...
> > > > ....
> > > > ....
> > > >
> > > > sleep(60);
> > > >
> > > > };
> > > >
> > > > };
>
> --
> SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
> To unsubscribe send email to [EMAIL PROTECTED] with
> unsubscribe in the text
--
SLUG - Sydney Linux Users Group Mailing List - http://www.slug.org.au
To unsubscribe send email to [EMAIL PROTECTED] with
unsubscribe in the text