Database updates are currently performed by sequentially copying the
nanet_names.master or whitepages_database files to ``new'' files (those
ending in .new). If the file copy happens successfully, the current
database is linked to
The new files are locked during updates so that two concurrent writes cannot happen, though others can read the database while it is being updated. The actual update - replacment of the old database file with the new - is atomic; queries can never see an inconsistent copy of the database file.
In order to prevent race conditions or locking the database for an excessive period of time, some operations may have to be backed out. For example, if someone tries to delete a subscriber record using the first and last names of the subscriber, and more than one subscriber has those names. In this case NA-NET will detect the condition, issue an appropriate message, and discard the new copy of the database (which may already have some records deleted) instead of replacing the old file. (Thus, the presence of a .new file does not mean that file contains more current information.)
In addition to the normal system backups, and the .old files, there is a cron job (/usr/local/na-net/rotate.sh) that gets run once per day that saves an extra copy of the NA-NET databases. Currently these are kept for five days.
A summary of NA-NET activity for a given day is run from cron at 11:59 pm. The summary script is in (/usr/local/na-net/summary.sh)
There is currently no mechanism for rotating log files.