CHAPTER 11 Recycling Backup Volumes

Previous Chapter : Next Chapter : Top


Table of Contents


The system administrator must decide how long to store backed up data before recycling or re using the storage media. The goal is to provide maximum data security while using the least amount of storage media.

When setting up a recycling schedule, determine how long to store backed up data, balancing the value of the backed up data with the value of the media on which it is backed up.

Once a full backup has been superseded by a newer full backup, you must also determine how long to preserve the old full backup (and its associated incremental backups) that is, when you will recycle and re use the storage volumes for another backup.


How Recycling Works

To help control and manage which backup volumes are released for re use and when, BACKUP.UNET allows you to automate a schedule of recycling backup media using the nvol -recycle command or a GUI recycle option and the recycle script. Only data from default named backups can be automatically recycled.

Automatic recycling is recommended for BACKUP.UNET sites, since it relieves you of the burden of tracking backup volumes and takes advantage of the BACKUP.UNET media management capabilities. You also can recycle volumes manually.

Automatic Recycling

After a backup has completed successfully, the nbk.bterm processing escape is automatically invoked by the BRP daemon as the very last step in the procedure. As part of its processing, nbk.bterm runs the nvol -recycle command.

By default, the nvol -recycle command reads the '$NBK/nbkRECYCLE' file (the default recycle script) to determine if any backup volumes are ready for recycling. It identifies eligible volumes, frees those volumes for reuse, and deletes the associated data information. A log of the processing performed is reported in the '$NBK/nbkLOG' file.

Manual Recycling

You can recycle backup volumes manually by using either the nvol -recycledump command or the manual recycle option from the GUI, and specifying either the date, dump name, or id of the backup volumes to be recycled.


Recycle Script

The recycle script is a text file made up of control statements. These statements define which volumes holding a full backup are preserved after a specified time period has passed, and which other volumes or volume segments become available for re use.

The recycle script also allows you to schedule information data to be automatically offlined (deleted), without recycling the associated backup volumes.

Note: Most installations find the BACKUP.UNET default recycle script fits their needs very well. The statements in the default recycle script ensure that recycling is done on a consistent basis, without requiring you to manually schedule and monitor the preservation of backup data. However, if you find that your site has special recycling needs, contact MTI Customer Support regarding a custom recycle script for your site.

Default Recycle Script

The default recycle script establishes a common recycling schedule. Recycling is based on age, not the number of times a volume is used or number of volumes remaining. Figure 11-1 shows the contents of the default '$NBK/nbkRECYCLE' file as it appears in your BACKUP.UNET directory upon installation.

Graphic: Figure 11-1. Contents of Default '$NBK/nbkRECYCLE' File

The statements in the default recycle script in Figure 11-1 are briefly described below:

If a weekly full backup is run and the recycle script is automatically invoked, the effects of each of these statements is updated every week.

Recycle Script Format

A recycle script contains any number of recycle control statements, each separated by a newline character (LF/CR), a semi colon(;), a comma (,), or a period(.). You can add blank lines and comments to the recycle script to improve its readability.

Valid recycle control statements are PRESERVE, OFFLINE, EXIT, and QUIT. The following pages provide information on these statements.


PRESERVE Statement

The PRESERVE statement controls the length of time backup volumes or volume segments stay in use before they are recycled and freed for use in another backup.

Note: A recycle statement with no descriptive words implies that all descriptive words are in effect.

Format

[ PRESERVE ][ ONLY ][ n ] [- ] periodA [DUMPS ]
[ AFTER ] [ n ] [- ] periodB

Definitions


OFFLINE Statement

The OFFLINE statement defines when the online data information is to be deleted from the system, not when the backup volumes are to be recycled. The OFFLINE statement deletes only the online data associated with a specific backup after the time specified in the recycle script.

Although the OFFLINE statement deletes the data on backed up files, it retains the index record or labels of which volumes hold the backup. No data information remains in the tables; only the labels of volumes containing backed up files remain. Data which is OFFLINE can be brought ONLINE at any time.

Many installations use an OFFLINE statement along with PRESERVE statements to specify that, as backup volumes are preserved (that is, not recycled), the associated data is deleted. This can save considerable disk space.

If no OFFLINE statement exists in the recycle script, the data information in the tables is kept online, as long as the associated backup components are preserved.

Format

Definitions

For the OFFLINE statement, period represents the time from the latest last modified time of the associated full backup. This is different than the PRESERVE statement, where periodB refers to the time elapsed since the last associated full backup was run.

Example

You want to delete data information for in use backup volumes after two weeks have passed, enter the command below. Only the volume information for the preserved backups is retained.


EXIT and QUIT Statements

EXIT and QUIT are synonymous. These statements, as well as any end of file action (for example, CTRL-D), indicate the end of a recycle script or session.

All subsequent statements are ignored and can be regarded as comment lines. The following example shows a sample recycle script using an EXIT statement:

All text following the EXIT statement is ignored; it can be used for further comments.


Automatic Recycling

Once you have established and implemented a regular schedule of running backups (that is, after two weeks), you will not need to save all backups. You can let BACKUP.UNET recycle unneeded backup volumes and data, so they can be re used to hold subsequent backups.

If you use the BACKUP.UNET default recycle script, when and what to recycle is set upon installation. All processing is performed automatically at regular intervals and reported in the $NBK/nbkLOG' file.

You may choose to modify the statements in the default recycle script and have recycling performed automatically, as often as you specify. Or if you prefer, MTI Customer Support will write a custom recycle script for your site.

Recycling and the First-Ever Backup

The first ever full backup is NEVER recycled automatically. This backup is normally required in order to find the first ever version of the file system (as a time reference point).

If you really want to delete the first ever backup (for example, because you have updated the file system), you can use the nvol -recycledump dump|date|id command to force the first ever backup to be recycled. In this case, the backup closest in time to the first ever backup becomes the new first ever backup and is never recycled automatically.

Using the Default Recycle Script

By default, BACKUP.UNET is set up to run the nvol -recycle command after every backup, via the backup termination escape program called nbk.bterm. (See Chapter 8, Using Processing Escapes, for more information on nbk.bterm.)

By default, each time the nvol -recycle command is invoked, it reads the '$NBK/nbkRECYCLE' file to determine which volumes to recycle and when.

The goal of the default recycle script is to preserve the latest version of the most recent full backup and its associated incremental backups, as well as backup versions from selected earlier points in time. At the same time, it recycles enough backups so that you do not accumulate more preserved backups than you need.

When nvol -recycle is invoked automatically, the specified recycle script is read on a line by line basis. If there are no syntax errors, processing is performed and reported in the $NBK/nbkLOG' file. If syntax errors are encountered, processing halts.

Modifying the Default Recycle Script

If the default recycle script does not meet your site's recycling requirements, you can modify the statements in the script.

To modify the default recycling schedule, simply edit the '$NBK/nbkRECYCLE' file. (Refer to Using the Default Recycle Script on page 11 12 to modify and/or construct a recycle script.)

To invoke the nvol -recycle command at a time other than at the completion of each backup operation, you can modify the default nbk.bterm processing escape in the '$NBK/nbk-ESCAPES' directory. You can then run the nvol -recycle command automatically using the UNIX cron utility, or you can issue the command interactively from a terminal.

Regardless of when you invoke the nvol -recycle command, recycling is not performed unless eligible backups are found when the recycle script is read. This is why the nvol -recycle command can be run automatically at the completion of every backup without the risk of recycling data prematurely.

Usage Notes


Manual Recycling

Use the nvol -recycledump dump|date|id command to manually recycle backup volumes and data associated with the dump or date specified. The command recycles backup volumes and deletes the associated information data.

You can use nvol -recycledump dump|date|id any time you need to force the recycling of particular backup volumes and data.

The nvol -recycledump dump|date|id command is typically used to recycle:

WARNING: Carefully consider using the nvol -recycledump command. If you forcibly delete a dump related volume, BACKUP.UNET will be unable to locate files to be restored on the associated backup volumes.

When you issue the nvol -recycledump dump|date|id command, processing begins immediately, and the action is logged in the $NBK/nbkLOG' file. If syntax errors are detected, processing halts.

Example

Use the -recycledump option of the nvol command to recycle a full backup named 'dump27':


Offlining Backup Information

BACKUP.UNET stores information about its backups in online tables. These tables contain data and information about backup volumes used in a backup cycle. However, between the time a backup volume is created and it is recycled (if ever), you may want to free disk space used by backed up data files. This process is called offlining. You can offline backup information either automatically or manually.

Note: To recreate the data information in the tables once it has been offlined, the volumes must be explicitly onlined. Use the ncat -online command.

Automatic Offlining

Using the OFFLINE statement in the recycle script, you can automate a schedule for deleting the data and information file portions of a backup while retaining the labels of the associated volumes online.

The OFFLINE statement deletes only the online data associated with a specific backup. It retains the index record or labels of which volumes hold the backup. No data information remains in the tables, only the labels of volumes containing backed up files remain.

When an OFFLINE statement is used, the data portion of both the full backup and its associated incremental backups (if any) are deleted. Offlining has no effect on the physical volumes of backed up data.

Manual Offlining

The ncat -offline dump command deletes the information on backed up files but retains a record of which volumes contain the backup. There is no data information for a dump that has been offlined.

The ncat -offline dump command is typically used to release space in the database used by backed up data files whose backup volumes are still in use, for example:

Note: The size of the database is not reduced but space is made available for additional backups.


Onlining Backup Information

To recreate the data information in the tables once it has been offlined, you must explicitly online the volumes. Use the ncat -online dump command to re create the previously deleted data of an existing backup you specify.

Note: To recreate the data information in the tables once it has been offlined, the volumes must be explicitly onlined.


Listing Catalogs and In Use Volumes

To list names and volumes for all existing backups, use ncat -list or ncat -listfull.


Recycling and the Append Feature

When backing up files using the BACKUP.UNET append feature, be careful how you add dumps to partially used volumes and how that affects the recycle process.

For example, if the backup cycle for a single machine puts all incremental backups for several weeks for that machine on a single volume, some of the segments are recycled during a backup cycle, and others are not. This allows an incremental recycling situation to occur.

A better way to handle appending dumps to volumes, is to add all incremental backups for a single day for all systems to the same volume, or to back up incremental backups from one machine from one dump cycle. This way, every segment on the volume is recycled at the same time and the entire volume is available for re use.