Retention Policies

From The Open Source Backup Wiki (Amanda, MySQL Backup, BackupPC)
Jump to navigationJump to search

Retention of Backup data for only a limited length of time, is a very useful tool to optimize the space consumed by backups. ZRM for MySQL retention policies automatically purges backup sets which are past their retention date.

ZRM for MySQL runs everyday to see if such past retention sets exists on the backup drive. If they exist, they are purged.

Purge is the action that has to be specified for configuring backup policy. The default is that data is to be retained forever.

Configuration

The retention policy can be made applicable globally by storing it in the global configuration file, or applicable to a specific backup set by specifying it in its specific configuration file. The specific policy will over-ride the global in case of conflict. Retention policy can also be specified on Command Line and its parameters will over-ride the parameters in the two previous configuration files. When the purge action is specified, backups whose retention policies has been exceeded in the backup directory specified by the destination option are removed

Specify Retention policy as under:

retention-policy <backup retention time>
  • Backup image for this backup run will retained for the time specified as parameter.
  • A suffix of 'D' indicates time specified in days.
  • A suffix of 'W' indicates amount specified in weeks (number of days are computed as 7*amount).
  • A suffix of 'M' indicates amount in months (number of days are computed as 30*amount).
  • A suffix of 'Y' indicates amount specified in years (number of days are computed as 365*amount).

For example: if --retention-policy 10M is specified, it indicates that the backup should be retained for 300 days. If no suffix is specified, the amount specified is assumed to be number of days the backup should be retained.

The default value is, retain backups forever.

Recommendations: A good retention policy will provide for certain amount of data to over lap and continue to be retained even though there is another backup set where it is already covered.

For example, you may have configured a daily incremental backup and a weekly incremental backup with monthly full backups. If you set the policy such that daily backups are purged as soon as the weekly backup has taken place, you will never be able to recover from the failure of the weekly backup.

Set the policy such that daily incremental backups are retained for 10 days, weekly incremental backups are retained for 6 weeks and monthly backups are retained for at least two months.

Note: If the statutory requirements or the needs for audit require the full backup data to be retained forever, consider transferring it periodically to a different storage media using a backup tool like AMANDA.

Purging Backups Whose Retention Period Has Expired

ZRM for MySQL has a very simplified mechanism for enforcing the retention policy. The database administrator has no active role to play beyond specifying the policy. Purging happens automatically everyday at 4 AM to purge sets past retention date.

Backup Reports Query Tool

The Backup reports query tool can be used to query backup sets as to the retention policy associated with them.