Backup Lifecycle & Housekeeping
This section will help you understand the components and functionality of backup lifecycle with CxLink Backup.
Topics
Overview
The configuration can be found in the emory.cfg configuration file in the following format:
_15LifeCycle:_15 active: true_15 Log:_15 Retention: 15_15 Daily:_15 Retention: 15_15 Weekly:_15 CronExpression: 0 0 * * 0_15 Retention: 90_15 Monthly:_15 CronExpression: 0 0 1 * *_15 Retention: 120_15 Yearly:_15 CronExpression: 0 0 1 1 *_15 Retention: 720
Configure Backup Lifecycle
Follow these steps to configure the CxLink Backup lifecycle before you start performing your backups.
- Start emory settings tool by executing
/opt/emory/emory
as <sid>adm - Select Lifecycle from the main menu.
_10 ? CxLink Backup: [Use arrows to move, type to filter]_10 Storage Providers profiles_10 Data storage providers for backups & restores_10 Specific Database configuration for Oracle database_10 License Software_10 Logging settings_10 Syntax Backups Dashboard_10> Backups Lifecycle_10 Exit
- Enable lifecycle options and configure them:
_10? Select action to perfom: Backups Lifecycle_10? Enable backups lifecycle? Yes_10? Select : [Use arrows to move, type to filter]_10> Configure Log Retention_10 Configure Daily Retention_10 Configure Weekly Retention_10 Configure Monthly Retention_10 Configure Yearly Retention_10 Deactivate Lifecycle_10 Return
-
Specify the proper information for each specific retention period:
- For log retention, specify the retention days after which the logs will be purged:
_10? Select : Configure Log Retention_10? Set the number of retention days: (0) 15
- For daily retention, specify the retention days after which the backups will be purged:
_10? Select : Configure Daily Retention_10? 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:
_11? Select : Configure Weekly Retention_11? Select action to perfom: Edit existing profile_11? Set the number of retention days: 90_11? Choose the day of the week [Use arrows to move, enter to select, type to filter]_11> Sunday_11Monday_11Tuesday_11Wednesday_11Thursday_11Friday_11Saturday
- For Monthly retention, specify the retention days and the day of the month (DoM) for the backup to be performed:
_10? Select : Configure Monthly Retention_10? Set the number of retention days: 120_10? Choose monthly retention [Use arrows to move, enter to select, type to filter]_10Specific Weekday of every Month_10Day of every Month_10> First Day of every Month_10Last Day of every Month_10Back
- For Yearly retention, specify the retention days and the day of the year (DoY) for the backup to be performed:
_10? Select : Configure Yearly Retention_10? Set the number of retention days: 720_10? Yearly Menu [Use arrows to move, enter to select, type to filter]_10> First day of the Year_10Last day of the Month_10Day of specific month_10Specific day of Year_10Back
- For log retention, specify the retention days after which the logs will be purged:
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 expresion | description |
---|---|
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>#1 | First Week Of Month, where <wd> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday] |
0 0 * * <wd>#2 | Second Week Of Month, where <wd> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday] |
0 0 * * <wd>#3 | Third Week Of Month, where <wd> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday] |
0 0 * * <wd>#4 | Fourth Week Of Month, where <wd> [0: Sunday, 1: Monday, 2: Tuesday, 3: Wednesday, 4: Thursday, 5: Friday, 6: Saturday] |
0 0 * * <wd>#L | Last 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:
- Start emory settings tool by executing
/opt/emory/emory
as <sid>adm - Select Backups Lifecycle settings from the main menu.
_17? CxLink Backup: [Use arrows to move, enter to select, type to filter]_17 --------------------------------------------------------------------------------_17 Storage Providers profiles_17 Set storage providers for backup/restore, disaster recovery and system copy_17 Configuration for DB2_17> Backups Lifecycle settings_17 Monitoring_17 --------------------------------------------------------------------------------_17 License_17 --------------------------------------------------------------------------------_17 Logging file settings_17 Debug traces_17 Show relevant information of this CxLink Backup_17 --------------------------------------------------------------------------------_17 Catalog & Backups management_17 --------------------------------------------------------------------------------_17 Exit
- Select
Delete expired backups automatically
:
_10? CxLink Backup: Backups Lifecycle settings_10? Select : [Use arrows to move, enter to select, type to filter]_10 Configure Log Retention_10 Configure Daily Retention_10 Configure Weekly Retention_10 Configure Monthly Retention_10 Configure Yearly Retention_10 Deactivate Lifecycle_10> Delete expired backups automatically_10 Back
- Answer
Yes [Y]
when prompted:
_10? CxLink Backup: Backups Lifecycle settings_10? Select : Delete expired backups automatically_10? Delete automatically expired backups? (Y/n) Y
- You can go now back and save the new configuration.
You can see the parameter in you configuration file with the following syntax:
_10LifeCycle:_10 Enabled: true_10 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
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
- Disable S3 Replication Time Control. S3 RTC is enabled by default and it must be disabled to have CxLink Backup Lifecycle operations working properly. Reference: https://docs.aws.amazon.com/AmazonS3/latest/userguide/replication-time-control.html