Differential backups are not being deleted by my maintenance plan.

  • Thanks to anyone who could help. SQL Server 2000/SP4 environment

    I am running the following differential backup

    DECLARE @BackupName varchar(1000)

    SET @BackupName = '\\MYSERVER\MYFOLDER\MYDB_' + convert(varchar(12),getdate(),112) + replace(convert(varchar(5),getdate(),108),':','')+ '_DIFF.BAK'

    BACKUP DATABASE [MYDB] TO DISK = @BackupName WITH INIT , NOUNLOAD ,RETAINDAYS = 2, DIFFERENTIAL , NAME = N'MYDB backup', NOSKIP , STATS = 10, NOFORMAT

    Separately I have a maintenance plan with a full backup where I remove files older than 3 days with the BAK extension. Same folder as above, \\MYSERVER\MYFOLDER\. My old full backups get deleted but not the differentials.

    I thought that RETAINDAYS = 2 would flag the file as one that could be deleted and that the maintenance plan would remove it up. Any guidance would be appreciated.

  • I think there is something that reads a header and deletes files, not just based on the extension. I found some issues with this in 2005, and I wouldn't be surprised if 2000 wouldn't delete the files.

    There are some scripts here on the site that contain VBScript, which can help you.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply