LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Run program in daemon mode (https://www.linuxquestions.org/questions/linux-general-1/run-program-in-daemon-mode-335319/)

gubak 06-20-2005 12:47 AM

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!

ag2uki 06-20-2005 01:04 AM

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

for example:
./yourscript.sh &

regards
ag2uki

gubak 06-20-2005 01:15 AM

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!

ag2uki 06-20-2005 01:23 AM

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


All times are GMT -5. The time now is 02:17 PM.