Skip to content

Commit

Permalink
Merge pull request #2475 from BurtCrowne/2474_AllNightLog_Setup-needs…
Browse files Browse the repository at this point in the history
…-check-for-@BackupPath

Update sp_AllNightLog_Setup.sql
  • Loading branch information
BrentOzar authored Jul 14, 2020
2 parents 4d19d1a + 56d205c commit d08dfec
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion sp_AllNightLog_Setup.sql
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ BEGIN
@RunSetup BIT, defaults to 0. When this is set to 1, it will run the setup portion to create database, tables, and worker jobs.
@UpdateSetup BIT, defaults to 0. When set to 1, will update existing configs for RPO/RTO and database backup/restore paths.
@RPOSeconds BIGINT, defaults to 30. Value in seconds you want to use to determine if a new log backup needs to be taken.
@BackupPath NVARCHAR(MAX), defaults to = ''D:\Backup''. You 99.99999% will need to change this path to something else. This tells Ola''s job where to put backups.
@BackupPath NVARCHAR(MAX), This is REQUIRED if @Runsetup=1. This tells Ola''s job where to put backups.
@Debug BIT, defaults to 0. Whent this is set to 1, it prints out dynamic SQL commands
Sample call:
Expand Down Expand Up @@ -288,6 +288,14 @@ Basic path sanity checks
*/

IF @RunSetup = 1 and @BackupPath is NULL
BEGIN

RAISERROR('@BackupPath is required during setup', 0, 1) WITH NOWAIT;

RETURN;
END

IF (@BackupPath NOT LIKE '[c-zC-Z]:\%') --Local path, don't think anyone has A or B drives
AND (@BackupPath NOT LIKE '\\[a-zA-Z0-9]%\%') --UNC path

Expand Down

0 comments on commit d08dfec

Please sign in to comment.