[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) [
Your-command-here;
]

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;  

Example:

Your-command-here;
Sleep(someamountoftime);


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.


Geoff


 
 

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....

Like

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

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

Regards,

Umair Shakil
ETD

 _______________________________________________
CentOS mailing list
CentOS at centos.org
http://lists.centos.org/mailman/listinfo/centos



More information about the CentOS mailing list