07-14-2023 02:33 PM
Hi,
I need to delete my Exchange Full Backup Set after 6 days automatically but the incremental sets are blocking the deletion because of their expiry time which is more than the Full Backup set. How can I let the system delete the Incremental sets together with the Full Backup?
Thanks.
07-14-2023 06:19 PM
The full backups would be automatically deleted once its dependencies (the incrementals) are deleted.
07-18-2023 05:22 AM
There are a few ways to let the system delete the Incremental sets together with the Full Backup. One way is to change the retention policy for the Incremental sets to expire at the same time as the Full Backup. You can do this by following these steps:
Once you have changed the retention policy for the Incremental sets, they will be deleted automatically along with the Full Backup after the specified number of days.
Another way to let the system delete the Incremental sets together with the Full Backup is to use a PowerShell script. The following PowerShell script will delete all Incremental sets that are older than the specified number of days:
$days = 6 $backups = Get-Backup -BackupType Incremental foreach ($backup in $backups) { if ($backup.ExpirationDate -le (Get-Date).AddDays($days)) { Remove-Backup -Backup $backup } }
This script will first get a list of all Incremental backups. It will then iterate through the list of backups and delete any backups that are older than the specified number of days.
You can run this script from the Exchange Management Shell or from a command prompt.
Once you have run the script, all Incremental sets that are older than the specified number of days will be deleted automatically.