LinuxQuestions.org
Help answer threads with 0 replies.
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 06-20-2005, 12:47 AM   #1
gubak
Member
 
Registered: Jul 2004
Posts: 332

Rep: Reputation: 30
Run program in daemon mode


I have written a small script (controls the internet with ping command).
I want this script to run in every five minutes.
My question is:
How can I run this script in daemon mode?
Or simply put infinite "while" cycle in the code, which is performing the ping command every five minutes?

Thank you!

Last edited by gubak; 10-06-2006 at 06:46 AM.
 
Old 06-20-2005, 01:04 AM   #2
ag2uki
Member
 
Registered: Oct 2004
Location: Yogyakarta, Indonesia
Distribution: Mandrake 9.0, 9.1, 9.2, 10.0
Posts: 84

Rep: Reputation: 16
You can use '&' in the end of your script command...
It will run in background..

for example:
./yourscript.sh &

regards
ag2uki
 
Old 06-20-2005, 01:15 AM   #3
gubak
Member
 
Registered: Jul 2004
Posts: 332

Original Poster
Rep: Reputation: 30
ok thanks!
But for example, if I want to ping in every five minutes, in that case do I put the code

"ping -c 2 62.108.119.145"

or

"while true;
do
ping -c 2 62.108.119.145
done"


Thanks!

Last edited by gubak; 10-06-2006 at 06:47 AM.
 
Old 06-20-2005, 01:23 AM   #4
ag2uki
Member
 
Registered: Oct 2004
Location: Yogyakarta, Indonesia
Distribution: Mandrake 9.0, 9.1, 9.2, 10.0
Posts: 84

Rep: Reputation: 16
hhhmm....
we can use 'cron' or 'at' in linux utility
see: http://www.linuxhelp.net/guides/cron/
 
  


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
i8kmon not working in daemon mode ghight Ubuntu 0 05-09-2005 08:58 AM
how to run a program as a daemon? iclinux Linux - Newbie 2 04-20-2005 12:11 AM
forcing program to run in root mode acidjuice Linux - Software 1 03-09-2005 07:17 AM
Start program in daemon mode from cgi-bin Xa! Programming 1 11-30-2004 11:00 PM
Running in daemon mode socks Slackware 1 10-15-2004 08:27 PM

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

All times are GMT -5. The time now is 12:46 PM.

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