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 'startfetchmywe ather.pl', that only
contains this command: exec ('fetchmyweathe r.pl') or print STDERR "couldn't
exec foo: $!";
3) created an html page that contains this: <!--#exec
cmd="cgi-bin/startfetchmywea ther.pl"-->
I'm not totally sure about this, but I thought if I called the html page, it
would execute 'startfetchmywe ather.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 3 7006
Jenkins wrote: 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 'startfetchmywe ather.pl', that only contains this command: exec ('fetchmyweathe r.pl') or print STDERR "couldn't exec foo: $!";
3) created an html page that contains this: <!--#exec cmd="cgi-bin/startfetchmywea ther.pl"-->
I'm not totally sure about this, but I thought if I called the html page, it would execute 'startfetchmywe ather.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
Sounds like you want to run a perl script every hour to fetch some
information and deposit it in a dB. Why not use a cron job that runs
your script every hour..? A crontab entry like this:
0 * * * * /path/to/your/script.pl
will run your script every hour on the hour.
One possible problem with your approach is that the uid/gid that your
web server runs under may not have adequate permission to launch a
detached process. (Since you don't specify the O/S or web server
software, it's difficult to guess.)
Greg
Thanks. I only have ftp access to the server, otherwise, I could have used a
cron. Also, if I do it the way I mentioned, is there any way to obtain and
kill the child pid?
doug
"Ga Mu" <Ng******@SPcom cast.netAM> wrote in message
news:M854b.3073 46$Ho3.43699@sc crnsc03... Jenkins wrote:
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 'startfetchmywe ather.pl', that
only contains this command: exec ('fetchmyweathe r.pl') or print STDERR
"couldn't exec foo: $!";
3) created an html page that contains this: <!--#exec cmd="cgi-bin/startfetchmywea ther.pl"-->
I'm not totally sure about this, but I thought if I called the html
page, it would execute 'startfetchmywe ather.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
Sounds like you want to run a perl script every hour to fetch some information and deposit it in a dB. Why not use a cron job that runs your script every hour..? A crontab entry like this:
0 * * * * /path/to/your/script.pl
will run your script every hour on the hour.
One possible problem with your approach is that the uid/gid that your web server runs under may not have adequate permission to launch a detached process. (Since you don't specify the O/S or web server software, it's difficult to guess.)
Greg
hmm
well, unless you get the cooperation of your admins,
maybe you could do something like set cron to wget a
particular html doc which would cause the script to run, doing
this every hour or whatever.
the doc may be in a non-linked-to dir so that its discovery
woudl be unlikely (not that it really matters, i guess).
while it seems there are some other things youd like to do,
perhaps you could build on this basic idea.
im pretty out of it right now, so i hope this is of help - if not, then
have a good laugh :)
Jenkins wrote: Thanks. I only have ftp access to the server, otherwise, I could have used a cron. Also, if I do it the way I mentioned, is there any way to obtain and kill the child pid?
doug
"Ga Mu" <Ng******@SPcom cast.netAM> wrote in message news:M854b.3073 46$Ho3.43699@sc crnsc03... Jenkins wrote:
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 'startfetchmywe ather.pl', that only contains this command: exec ('fetchmyweathe r.pl') or print STDERR "couldn't exec foo: $!";
3) created an html page that contains this: <!--#exec cmd="cgi-bin/startfetchmywea ther.pl"-->
I'm not totally sure about this, but I thought if I called the html page, it would execute 'startfetchmywe ather.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
Sounds like you want to run a perl script every hour to fetch some information and deposit it in a dB. Why not use a cron job that runs your script every hour..? A crontab entry like this:
0 * * * * /path/to/your/script.pl
will run your script every hour on the hour.
One possible problem with your approach is that the uid/gid that your web server runs under may not have adequate permission to launch a detached process. (Since you don't specify the O/S or web server software, it's difficult to guess.)
Greg This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Larry Woods |
last post by:
I have a site that works fine for days, then suddenly, I start getting ASP
0115 errors with an indication that session variables IN SEPARATE SESSIONS
have disappeared!
First, for background information, I have a customized 500-100 page that
sends the value of various session variables via email to my support site.
The situation:
On the home page of the site, the FIRST THING that is done is a Session
|
by: Serdar Kalaycý |
last post by:
Hi everybody,
My problem seems a bit clichè but I could not work around.
Well I read lots of MSDN papers and discussions, but my problem is a bit
different from them. When I tried to run the project in debug mode (by
hitting F5) it gives an error message
"Error while trying to run project: Unable to start debugging on the web
server.
|
by: Tim D |
last post by:
Hi,
I originally posted this as a reply to a rather old thread in
dotnet.framework.general and didn't get any response. I thought it might be
more relevant here; anyone got any ideas? My questions are below...
"David Good" wrote:
> We have a network running both Win2k and Win2k3 webservers and our web sites
> reside on a UNC network share that happens to be a Network Appliance NAS.
|
by: JDS |
last post by:
Hi. I have installed the PCNTL functions on my PHP enabled webserver
in the interest of being able to fork a process into the background so I
can do some heavy processing but return control of the browser back to the
user rather quickly.
However, after mucking about with PCNTL for a while and not getting the
results I expected, I finally stumbled across this line in the opening
parragraph on PCNTL functions on PHP.net:
"Process...
|
by: Paul |
last post by:
Hi,
I am trying to start a process hidden. My code:
wordprocess = new System.Diagnostics.Process(); ;
wordprocess.StartInfo = new System.Diagnostics.ProcessStartInfo(wcmd,
args);
wordprocess.StartInfo.WindowStyle =
System.Diagnostics.ProcessWindowStyle.Hidden;
wordprocess.StartInfo.WorkingDirectory = TemplatePath.Substring(0,
TemplatePath.Length - 1);
| |
by: Mark Huebner |
last post by:
I am trying to create a web application with Visual Studio 2005 and C# that
will start up a "keep alive" application on my web site's server. My
DotNetNuke home page loads slowly when the site hasn't been accessed for a
while. The purpose of the "keep alive" application is to keep my web site
alive (loaded in memory) by accessing a page on the server every 5 minutes
or so. I've tried using Process.Start to run a console application...
|
by: zxo102 |
last post by:
Hi,
I am doing a small project using socket server and thread in python.
This is first time for me to use socket and thread things.
Here is my case. I have 20 socket clients. Each client send a set
of sensor data per second to a socket server. The socket server will
do two things: 1. write data into a file via bsddb; 2. forward the data
to a GUI written in wxpython.
I am thinking the code should work as follow (not sure it is
feasible)...
|
by: Vinod Sadanandan |
last post by:
Fast-Start Failover An Overview In Dataguard Environment
=============================================================================
This article describes the automatic fast start failover configuration and the conditions for trigerring a fast start failover in dataguard environment .
In Faststart failover dataguard configuration if the primary database becomes unavailable, the...
|
by: namrataa |
last post by:
d:/IISerror.bmp
I am working on C# WCF VS2008. I am writing service using WCF service library to be hosted in IIS5.1 and the host is written using WCF service web site. So that it can be hosted in IIS. when i run the host application I get error saying " Unable to start debugging the web server, Make sure your operating system is running correctly. Verify there are no syntax errors in the web.config by doing start without debugging. You may...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |