J
Jenkins
I want to start a perl pgm in the background on my hosts web server as a
stand-alone process. I only have ftp access. What I've done, so far, is:
1) created the actual background perl script, named fetchmyweather.pl. This
script retrieves a string from an noaa weather station and inserts it into a
mysql db, then sleeps for an hour, and repeats indefinitely. Nothing heavy
and it's ok with my provider.
2) created a second perl script, named 'startfetchmyweather.pl', that only
contains this command: exec ('fetchmyweather.pl') or print STDERR "couldn't
exec foo: $!";
3) created an html page that contains this: <!--#exec
cmd="cgi-bin/startfetchmyweather.pl"-->
I'm not totally sure about this, but I thought if I called the html page, it
would execute 'startfetchmyweather.pl' in the foreground, which would spawn
'fetchmyweather.pl' as an unattached process on the host server. That would
allow me to close my browser without killing the 'fetchmyweather.pl' script.
First, I'm not sure if the process is actually getting started. It doesn't
seem to be since it should immediatelly fetch a string, insert it into the
table and then go to sleep for the first time. The first string is not
getting inserted.
Second, how can I monitor the process other than checking the mysql db for
new records every hour (not that I'd check it every hour...)?
Thanks,
doug
stand-alone process. I only have ftp access. What I've done, so far, is:
1) created the actual background perl script, named fetchmyweather.pl. This
script retrieves a string from an noaa weather station and inserts it into a
mysql db, then sleeps for an hour, and repeats indefinitely. Nothing heavy
and it's ok with my provider.
2) created a second perl script, named 'startfetchmyweather.pl', that only
contains this command: exec ('fetchmyweather.pl') or print STDERR "couldn't
exec foo: $!";
3) created an html page that contains this: <!--#exec
cmd="cgi-bin/startfetchmyweather.pl"-->
I'm not totally sure about this, but I thought if I called the html page, it
would execute 'startfetchmyweather.pl' in the foreground, which would spawn
'fetchmyweather.pl' as an unattached process on the host server. That would
allow me to close my browser without killing the 'fetchmyweather.pl' script.
First, I'm not sure if the process is actually getting started. It doesn't
seem to be since it should immediatelly fetch a string, insert it into the
table and then go to sleep for the first time. The first string is not
getting inserted.
Second, how can I monitor the process other than checking the mysql db for
new records every hour (not that I'd check it every hour...)?
Thanks,
doug