I am having trouble understanding what exactly to expect from the CleanupTime
option in the Ola Hallengren Server Maintenance Solution. I'm finding some related questions, and elaborate answers, but the explanations still puzzle me a bit.
Specifically:
I am doing a weekly FULL backup, a daily DIFF backup, and an hourly LOG backup.
The FULL backup is using the default CleanupTime
of 24h. The DIFF and LOG backup have NULL as CleanupTime
.
From the documentation of the CleanupTime paramter, I fail to understand if setting the CleanupTime
setting for a backup of BackupType
FULL, will also delete older DIFF and LOG backup files, or only FULL backup files.
Specify the time, in hours, after which the backup files are deleted. If no time is specified, then no backup files are deleted.
The latter paragraph makes me think that setting CleanupTime
on backups of BackupType
FULL will also delete older transaction logs. Yet it is unclear if this paragraph only applies to backups of the BackupType
LOG, or also to backups of the BackupType
FULL.
DatabaseBackup has a check to verify that transaction log backups that are newer than the most recent full or differential backup are not deleted.
What I am trying to achieve, is that I can do a point-in-time recovery up to 1 week. (We have a very slowly changing database, so this is feasible) The way I understand it now, this would require a week old full backup, and a weeks worth of Transaction log backup. Since the full, and differential backups can only be used to restore to one specific point in time.
So, should I just set the CleanupTime
option of my FULL backup job to 24*7
? What I'm guessing now is that setting it to 24h, will cause the next FULL backup to delete all older Full, diff and Transaction log backup files, leaving me with a point-in-time recovery window of ... 0 hours. Right?