adding cron jobs without hosing /etc/crontab

Christopher Hicks chicks at CHICKS.NET
Mon Dec 9 19:18:10 GMT 2002

In regard to the person who was talking about the duplicate entries ending
up in crontab, we have a local solution to this that might be helpful.
Red Hat provides a number of directories for adding hourly, daily, weekly,
and monthly jobs.  So, we've extended the concept to support mrtg running
every five minutes, mirror scripts that need to run every four hours or
four times a day.  The big advantage from the automated installation
perspective is that if a script we've put into an rpm finds that there is
no /etc/cron.4daily, then it creates the directory and add the necessary
line into crontab.  In rpm.spec terms, that'd be a pre-installation
script.  So then rpms puts the necessary script into the /etc/cron.4daily
directory over-writing if need-be.


Programming is a Dark Art, and it will always be. The programmer is
fighting against the two most destructive forces in the universe:
entropy and human stupidity. They're not things you can always
overcome with a "methodology" or on a schedule.
                -Damian Conway, Perl God

More information about the MailScanner mailing list