DNS Magic: cronjobs

The lastest version of this page can be found at:

The following list describes some of the standard modules provided for automating DNS updates. Not all are specific to DNS Magic. Note that we do not install many of these by default as every site has their own thoughts on what they do or do not want to automate.

The .list files mentioned refer to the configs(8) list that installs the file. If no .list is mentioned the file is not installed automagically and needs to be manually created (or a local .list file created) if desired. See configs(8) for details.

cronjob.list: Standard OS setup. cronjob.list, is included by dnsmagic-cronjob.list
cronjob.list: Just sets a suitable PATH
cronjob.list: Sets up environment such that all output can be collected and e-mailed to admin (see mailrep.sh)
dnsmagic-cronjob.list: This is not included with DNSMagic but will be installed if it can be found under /configs (eg. /configs/local/usr/local/share/dns/cron.d/lsetup.sh) and is a good place to set WORK_DIR to where you want DNS cron jobs to play. It goes without saying that WORK_DIR must exist and must contain a checked out copy of the DNS repository.
dnsmagic-cronjob.list: Provides interlocking between cron jobs.
cd's to WORK_DIR, ensures there is a private temp directory and updates PATH.
dnsmagic-cronjob.list: Makes sure that WORK_DIR has an up to date copy of the DNS repository.
Used in the hourly cronjob to handle one off scheduled changes. Basically it processes any files named for the current year month day and hour and renames them such that they will not be processed again even if atjobs is run multiple times in the same hour. The processing is handled in the same was as rc.sh(8).
dnsmagic-updrevs.list: Commits changes made so far. This is necessary for updrevs to do its job accurately. dnsmagic-updrevs.list includes dnsmagic-cronjob.list
This is the job that updates the live DNS directory and reloads or bounces the live named if needed. It is performed as part of S85updrevs, so only one of these jobs need be run. While /etc/rc_d/dnsmagic is always installed, the link to S82dnsmagic is not and must be manually made by sites that actually want this degree of automation.
dnsmagic-updrevs.list: This job is the main event. It updates the live tree with the just committed changes (unless .nomagic is present in WORK_DIR), and bounces named(8) if needed. It then runs getdb to get named(8) to dump its cache and then format it using getdata. Finally it runs updrev to generate any missing PTR records for networks that the nameserver is authoritative for.
dnsmagic-cronjob.list: Records the changes made by updrevs
dnsmagic-cronjob.list: Commits any changes (eg. made by updrevs)
dnsmagic-updrevs.list: This is the job that updates the live DNS directory and reloads or bounces the live named if needed.
cronjob.list: E-mails the report to admin, a copy will also be kept in WORK_DIR called hourly.rep for the hourly cron job.

$Id: cron.html,v 1.10 2001/08/30 07:48:42 sjg Exp $
Copyright © 1997-2001 Simon J. Gerraty