Backup Lifecycle & Housekeeping

This section will help you understand the components and functionality of backup lifecycle with CxLink Backup.

Topic

Overview

The configuration can be found in the emory.cfg configuration file in the following format:

LifeCycle:
  active: true
  Log:
    Retention: 15
  Daily:
    Retention: 15
  Weekly:
    CronExpression: 0 0 * * 0
    Retention: 90
  Monthly:
    CronExpression: 0 0 1 * *
    Retention: 120
  Yearly:
    CronExpression: 0 0 1 1 *
    Retention: 720

Configure Backup Lifecycle

Follow these steps to configure the CxLink Backup lifecycle before you start performing your backups.

  1. Start emory settings tool by executing /opt/emory/emory as <sid>adm
  2. Select Lifecycle from the main menu.
  ? CxLink Backup:  [Use arrows to move, type to filter]
  Storage Providers profiles
  Data storage providers for backups & restores
  Specific Database configuration for Oracle database
  License Software
  Logging settings
  Syntax Backups Dashboard
> Backups Lifecycle
  Exit
  1. Enable lifecycle options and configure them:
? Select action to perfom:  Backups Lifecycle
? Enable backups lifecycle? Yes
? Select :   [Use arrows to move, type to filter]
> Configure Log Retention
  Configure Daily Retention
  Configure Weekly Retention
  Configure Monthly Retention
  Configure Yearly Retention
  Deactivate Lifecycle
  Return
  1. Specify the proper information for each specific retention period:

    • For log retention, specify the retention days after which the logs will be purged:
      ? Select :  Configure Log Retention
      ? Set the number of retention days: (0) 15
      
    • For daily retention, specify the retention days after which the backups will be purged:
      ? Select :  Configure Daily Retention
      ? Set the number of retention days: (0) 15
      
    • For weekly retention, specify the retention days and the day of the week (DOW) for the backup to be performed:
      ? Select :  Configure Weekly Retention
      ? Select action to perfom:  Edit existing profile
      ? Set the number of retention days: 90
      ? Choose the day of the week  [Use arrows to move, enter to select, type to filter]
      > Sunday
      Monday
      Tuesday
      Wednesday
      Thursday
      Friday
      Saturday
      
    • For Monthly retention, specify the retention days and the day of the month (DoM) for the backup to be performed:
      ? Select :  Configure Monthly Retention
      ? Set the number of retention days: 120
      ? Choose monthly retention  [Use arrows to move, enter to select, type to filter]
      Specific Weekday of every Month
      Day of every Month
      > First Day of every Month
      Last Day of every Month
      Back
      
    • For Yearly retention, specify the retention days and the day of the year (DoY) for the backup to be performed:
      ? Select :  Configure Yearly Retention
      ? Set the number of retention days: 720
      ? Yearly Menu  [Use arrows to move, enter to select, type to filter]
      > First day of the Year
      Last day of the Month
      Day of specific month
      Specific day of Year
      Back
      

Use cron expressions

For the weekly, monthly and yearly retention periods you can use cron expressions to identify when the retentions should be applied. Use one of this examples if needed, to modify the configuration file manually:

cron expresiondescription
0 0 * * <n>Weekly. Set one day of week where <n> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday]
0 0 1 * *First Day Of Month
0 0 L * *Last Day Of Month
0 0 <n> * *Specific Day Of Month (n = day of month)
0 0 * * <wd>#1First Week Of Month, where <wd> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday]
0 0 * * <wd>#2Second Week Of Month, where <wd> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday]
0 0 * * <wd>#3Third Week Of Month, where <wd> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday]
0 0 * * <wd>#4Fourth Week Of Month, where <wd> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday]
0 0 * * <wd>#LLast Week Of Month, where <wd> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday]
* * 1 1 *First day of the Year
* * L 12 *Last day of the Month
* * <d> <m> *Specific day of Year, where <d>: day, and <m>: month

Auto Delete Expired Backups

You can make CxLink Backup to delete the expired backups each time a backup is executed. This operation will delete the file from both the catalog and the cloud storage destination.

To activate this option, follow these steps:

  1. Start emory settings tool by executing /opt/emory/emory as <sid>adm
  2. Select Backups Lifecycle settings from the main menu.
? CxLink Backup:  [Use arrows to move, enter to select, type to filter]
  --------------------------------------------------------------------------------
  Storage Providers profiles
  Set storage providers for backup/restore, disaster recovery and system copy
  Configuration for DB2
> Backups Lifecycle settings
  Monitoring
  --------------------------------------------------------------------------------
  License
  --------------------------------------------------------------------------------
  Logging file settings
  Debug traces
  Show relevant information of this CxLink Backup
  --------------------------------------------------------------------------------
  Catalog & Backups management
  --------------------------------------------------------------------------------
  Exit
  1. Select Delete expired backups automatically:
? CxLink Backup: Backups Lifecycle settings
? Select :   [Use arrows to move, enter to select, type to filter]
  Configure Log Retention
  Configure Daily Retention
  Configure Weekly Retention
  Configure Monthly Retention
  Configure Yearly Retention
  Deactivate Lifecycle
> Delete expired backups automatically
  Back
  1. Answer Yes [Y] when prompted:
? CxLink Backup: Backups Lifecycle settings
? Select :  Delete expired backups automatically
? Delete automatically expired backups? (Y/n) Y
  1. You can go now back and save the new configuration.

You can see the parameter in you configuration file with the following syntax:

LifeCycle:
  Enabled: true
  AutoDeleteExpired: true

Lifecycle and storage provider versioning and replication

If you have versioning and/or data replication activated there are some actions to be performed to have cxLink Backup lifecycle working properly.

AWS S3 bucket replication

AWS bucket replication requires versioning to be enabled.

Replication is supported by cxLink Backup. However versioning generates a noncurrent version of every deleted object, and by default those objects are never removed.

If cxLink Backup lifecycle has been activated to free up storage space from AWS S3, some configurations have to be done:

  • Create an S3 lifecycle rule to remove all noncurrent versions of an object older than 1 day in both buckets, original and replica

S3 lifecycle rule

Note: you can also check Delete expired object delete markers or incomplete multipart uploads (optional)

  • Configure a replication rule to replicate S3 Delete Markers from original bucket to its replica to avoid objects being recovered from replication bucket when cxLink Backup removes them from the original one

S3 replicate delete markers