Re: crontab help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Stardate 6609.08, mailing-list@xxxxxxx 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@excelsior cron.5min]# pwd
/etc/cron.5min
[root@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



[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux