olahallengren / sql-server-maintenance-solution

SQL Server Maintenance Solution
https://ola.hallengren.com
MIT License
2.91k stars 756 forks source link

Back up all databases in a single folder. #735

Closed henriquecof closed 1 year ago

henriquecof commented 1 year ago

Hi guys all good? Thanks in advance for any help. I would like to point out the backups,in use the subfolders option. With that I wanted to know, how can I change the script to perform all backups, for example FULL backups to a single folder. Thank you very much for the help.

Stiffboard commented 1 year ago

Hard to understand why that would be a good idea. But if you read the documentation there is a @DirectoryStructure = NULL to add.

EXECUTE [dbo].[DatabaseBackup] @Databases = 'SYSTEM_DATABASES', @Directory = NULL, @DirectoryStructure = NULL, @BackupType = 'FULL', @Verify = 'Y', --@CleanupTime = 23, @CheckSum = 'Y', @LogToTable = 'Y'

But then CleanupTime is not supported. So will have to cleanup with some other method.

The value for the parameter @CleanupTime is not supported. Cleanup is not supported if the token {DatabaseName} is not part of the directory.

henriquecof commented 1 year ago

Thanks for the help @Stiffboard , this approach we are doing is because of a strict internal rule of our IT area that does not want to change unfortunately. But with this information I can already standardize the way you want, thank you very much.