Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Executing CGI on a timer.

Status
Not open for further replies.

ZsN1Gman

Programmer
Aug 22, 2002
17
US
I have a few CGI programs that I need to run at certain intervals. These scripts will look at various pages and database files and make decisions based on the content.

This seems like such a trivial question, I see things like this done all the time. Someone noted that I could simply use javascript to invoke the scripts by refreshing a page every so often, but that sounds like a last resort.

There must be a better way than the js solution (a normal way). How is this typically done?

Thanks! Jim
 
On *nix environment, you could use crontab entries to schedule your scripts to run.

On Win* you can use the scheduler either AT, or WINAT

Pass the command line "perl myscript.pl"

HTH ;P
 
I think that bit of information just made my day!

You should hear some of the solutions people are spitting out around here. But you know what they say about groups.

I think now I have to take the rest of the week off.

Thanks,
 
>> but that sounds like a last resort.

That's not a resort it's a disaster!

PaulTEG has the right idea.

-pete
 
The ghetto way .. and it wouldn't have happened (probably:)


You should have heard first runner up.. where every "once in awhile" the receptionist was supposed to click the refresh button.

 
Do you have access to the shell or crontab. If you dont there are other possibilities.
haunter@battlestrata.com
 
Haunter,

What are the other possibilities

PaulTEG
 
Another possibility would be to use a client to fire the request on AT, WINAT or cron

If console fires a browser session from a command line on the lines
Code:
C:\Windows\Desktop> [URL unfurl="true"]http://www.myserver.com/cgi-bin/myscript.pl[/URL]

A remote client can be set up to run the request at whatever number of intervals you require.

You might have to set up your browser not to open a new session each time a request is recieved

HTH

PS It is adding a few more points of failure to the system, so it should be avoided
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top