The dailybackup module runs daily at midnight and copies all files and directories older than 23 hours from the /nidb/backup directory to a temporary directory that will be written to tape. When the temporary directory reaches 750GB, it is written to an LTO-4 (800GB capacity) tape in triplicate. This module is not essential to running NIDB, and you may devise better backup schemes, but it is provided to do some basic backup.
Because of the structure of the archive, it is not feasible to search the archive (which can grow to many terabytes) for new data to backup to tape. So, any time data is written to the archive, it is also written to the /nidb/backup directory. All modules are designed to perform this mirroring of data the backup directory.
Ideally, the dailybackup module should run on a separate server, with the /nidb/backup directory mounted on the second server as an NFS share. This will ensure that if hardware failure occurs with the primary NIDB server, the oldest data that was not copied to the backup server will be no more than 23 hours old. This also ensures that if a hardware failure occurs on the backup server, that the original data is still intact on the primary NIDB server.
An additional strategy to prevent loss of data in case of hardware failure is to have a secondary NIDB server, such as NIDB1 and NIDB2, where users will always connect to NIDB1, but data is mirrored nightly and the MySQL instances run in a master/slave configuration. This will also ensure that if the primary server fails, the data should be safe, but the secondary server can be promoted to a primary and users can continue accessing data.
A recognized tape drive must be attached to the server with device name /dev/st0. The script should not be run through cron because it requires interaction by a user to load/eject tapes and press a key to indicate that tapes have been changed.
Start a command prompt as root (root is necessary to access the tape drive) and run the dailybackup module as follows
cd /nidb/programs perl dailybackup.pl