crontab help

Steve Cowles steve at stevecowles.com
Sun Aug 29 04:50:05 UTC 2004


On Stardate 6609.08, mailing-list at gmx.net said:
> Am Sonntag, 29. August 2004 04:49 schrieb Steve Foutty:
> 
>>I'm new to Fedora and would like a little help with crontab. I have a fresh
>>install and have just configured mrtg for monitoring a few devices. I tried
>>to follow the documentation for crontab but can't seem to get it right.
>>
>>How do I put mrtg into crontab so that it runs every 5 minutes..
>>
>>Thanks,
>>   Steve
> 
> 
> 5,10,15,20,25,30,35,40,45,50,55,0 * * * * username (programmname with full
> path)
> 
> the whole text in one line ...........
> 

Actually, the above can be summarized to:
*/5 * * * * username (programmname with full path)

Another approach - especially if you have more than one cronjob that 
needs to run every 5 minutes...

Example: This is ahow I run MRTG.

1) Make/Create a /etc/cron.5min directory

2) In /etc/crontab, add the following line:
*/5 * * * * root run-parts /etc/cron.5min

3) copy your mrtg script to /etc/cron.5min. Note: Make sure its executable.

[root at excelsior cron.5min]# pwd
/etc/cron.5min
[root at excelsior cron.5min]# cat run_mrtg
#!/bin/sh

LANG=POSIX
MRTG_DIR=/etc/mrtg/rrd

for CFG in `ls -1 ${MRTG_DIR}/*.cfg` ; do
         `which mrtg` "${CFG}"
done

Steve Cowles





More information about the fedora-list mailing list