SetRetentionTime

Description

This utility provides a command line method to adjust the basic retention rules for one or more or all storage policy copies.

Usage

  • We strongly recommend that a synchronous copy be defined before setting the retention for a primary copy to 0 days and/or 0 cycles. This synchronous copy should never be marked inactive. Otherwise, all backups from the primary copy will be pruned out without having a copy of them, and there may not be any successful backups retained.
  • Setting the retention days to -1 will set the retention to infinite. The tool will remove all extended rules defined for a storage policy copy automatically if its retention is set to infinite by the tool.
  • Use "ALL" as the storage policy name to set the retention for all storage policy copies of the CommCell.
  • Use "ALL" as a copy name to set the retention for all storage policy copies of a given storage policy.
  • Clicking the OK button on the properties window of the storage policy copy will overwrite the result of this tool. If you do so, the tool has to be run again on that storage policy copy to reset the retention.
  • Run this tool only on those copies of storage policies where this special facility is really needed.
  • This tool can be run for one or all storage policies/copies, or it can be executed using the .bat file for all required storage policies/copies.
  • Please run a disaster recovery backup before running this utility.

  1. Copy SetRetentionTime.exe to software_installation_directory\Base.
  2. Open a command window and change the directory to software_installation_directory\Base.
  3. Run the appropriate form of the following command (see Examples below):

    SetRetentionTime -sp SP Name -copy SP Copy Name -days Days [-cycles Cycles]

  4. Check the results in SetRetentionTime.log located under software_installation_directory\log files.

    The log file shows the new settings for the storage policy copies modified. It also shows any connection error or SQL Server error if such errors exist.

Examples

  • Command to set retention to 30 days and 1 cycles for copy "Primary" of storage policy "LONSC-S014-SP02":

    SetRetentionTime -sp LONSC-S014-SP02 -copy Primary -days 30 -cycles 1

  • Command to set retention to 30 days and 1 cycles for all copies of storage policy "LONSC-S014-SP02":

    SetRetentionTime -sp LONSC-S014-SP02 -copy ALL -days 30 -cycles 1

    SetRetentionTime -sp LONSC-S014-SP02 -days 30 -cycles 1

  • Command to set retention to 30 days and 1 cycles for all storage policies:

    SetRetentionTime -sp ALL -days 30 -cycles 1

  • Command to set retention to 30 days for all storage policies (no change to retention cycles):

    SetRetentionTime -sp ALL -days 30

    Retention for copies with infinite retentions will not be changed.

  • Command to set retention to two cycles for all storage policies (no change to retention days):

    SetRetentionTime -sp ALL -cycles 2

    Retention for copies with infinite retentions will not be changed.

  • Command to set retention to infinite for copy "Primary" of storage policy "LONSC-S014-SP02":

    SetRetentionTime -sp LONSC-S014-SP02 -copy Primary -days -1

  • Command to set retention to infinite for all copies of storage policy "LONSC-S014-SP02":

    SetRetentionTime -sp LONSC-S014-SP02 -copy ALL -days -1

    SetRetentionTime -sp LONSC-S014-SP02 -days -1

  • Command to set retention to infinite for all storage policies:

    SetRetentionTime -sp ALL -days -1

  • Command to set retention to 0 days and 0 cycles for copy "Primary" of storage policy "LONSC-S014-SP02":

    SetRetentionTime -sp LONSC-S014-SP02 -copy Primary -days 0 -cycles 0

    The tool does not allow this setting for all copies or a non-primary copy of a storage policy.