LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 11-24-2001, 11:19 PM   #1
f117bomb
LQ Newbie
 
Registered: Nov 2001
Location: California
Distribution: Mandrake
Posts: 6

Rep: Reputation: 0
Auto Run A Cgi Script


Im looking for a way to auto execute a cgi scipt on my linux mandrake apache webserver ever 15 min.

I know the cgi scipts can be execute simply by typing the name of the script at the command promt. Im not sure if there is a command u could use to do this or if there is a program i can download for linux.
 
Old 11-25-2001, 01:18 AM   #2
DavidPhillips
LQ Guru
 
Registered: Jun 2001
Location: South Alabama
Distribution: Fedora / RedHat / SuSE
Posts: 7,163

Rep: Reputation: 58
there are many ways to do it

crond is one way.

I have one running that is probably not the right way to do things but it works...

say the file is called myprog

I run it on boot from /etc/rc.d/rc.local

myprog &



heres the file contents
-----------------------------------------------------

#!/bin/sh
#
#
if blah then
blah blah
blah blah blah
fi
#end of script stuff

#here is the timed delay stuff
#sleep for 30 minutes
sleep 30m

#now restart and exit

myprog &
-------------------------------------------------------

as you see here the file restarts itself at the end, it sets it to the background so it can exit, then the whole thing starts over again.

doing ps -A will show myprog and sleep always running.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
auto run bash script when logged in linuxmandrake Fedora 1 06-11-2005 08:22 PM
configuring a cgi shell script to run keeg Linux - Newbie 1 06-09-2005 01:45 PM
Access forbidden when trying to run cgi script allan_y Linux - Software 4 10-07-2004 07:02 AM
Allow user to run their own cgi script samwong Linux - Newbie 5 05-25-2004 10:22 PM
cgi script doesn't run just downloads SchoolITguy Programming 3 12-19-2002 03:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 10:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration