I have a problem when I want to delete older backups, I've created with Ola Halengreen scripts.

USE Maintenance
EXECUTE dbo.DatabaseBackup
 @Databases = 'USER_DATABASES',
 @Directory ='/mssql/backup/',
 @DirectoryStructure ='${InstanceName}{DirectorySeparator}{DatabaseName}',
 @BackupType = 'FULL',
 @Compress = 'Y',
 @CleanupTime = 3

I got the following error message:

The value for the parameter @CleanupTime is not supported. Cleanup is not >supported on Linux.

So far so good, but whats the best way now to delete old Backups without to destroy the Backup chain?

My frist thought was to have a script to delete

find /mssql/backup -name "*.bak" -type f -mtime +3 -exec rm -f {} \;
find /mssql/backup -name "*.trn" -type f -mtime +4 -exec rm -f {} \;

The internal system of the SQL Server Instance will not recognize the clean up after the script was executed. The Backup History in the internal Backup Management will not updated and in the case of a recovery the system wants to have backups which are not existing anymore.

So does anyone have a solution to the problem?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.