[CentOS] Cron job

gjgowey at tmo.blackberry.net gjgowey at tmo.blackberry.net
Fri Oct 5 07:07:28 UTC 2007

What you need then is a repeating loop shell script that runs as a background task.

Basically the logic is:

While (true) [

Don't use the above syntax as it is incorrect, but that's the logic of your batch file.  You can then invoke it in rc.local by: 

/whereverthefileis/shellscript &

The & will cause it to be forced into the background.  The loop will run continuously because of the logic.  If you want to slow it down you can throw in a sleep statement after Your-command-here;  



You will of course need to refer to the bash or sh or whatever shell your script is going to execute under for the proper symantics for the while and sleep statements.



Sent from my BlackBerry wireless handheld.

-----Original Message-----
From: "umair shakil" <umairshakeel at gmail.com>

Date: Fri, 5 Oct 2007 11:50:01 
To:"CentOS mailing list" <centos at centos.org>
Subject: [CentOS] Cron job

Dear All Salam,

Is there a possibility that we can run MRTG command in seconds????

The only thing is know is we can run MRTG in one minute other than standard 5 minutes....


*/1 * * * * root env LANG=C /usr/bin/mrtg /etc/mrtg/test.cfg 

what if, i want to monitor traffic in seconds???


Umair Shakil

CentOS mailing list
CentOS at centos.org

More information about the CentOS mailing list