Problem

Retention of database backups.

Solution

Complement Ola’s database backup file retention by deleting database backups for databases that no longer exist.

Regular Schedule: Every Sunday at 8PM

Solution: Native T-SQL

  1. Deletes bak and trn files from the main folder that are older than [RetentionDays] days
  2. Delete bak and trn files from FULL/DIFF/LOG that are older than [RetentionDays] days
  3. Delete empty folder