Skip to content

Commit

Permalink
Changed names of jobs and schedules. Fixes #4972 (#4973)
Browse files Browse the repository at this point in the history
* Changed names of jobs and schedules. Fixes #4972

* Added back the source server name in the default copy and restore job
  • Loading branch information
sanderstad authored and potatoqualitee committed Jan 20, 2019
1 parent 2f19bfa commit 3a3d03d
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions functions/Invoke-DbaDbLogShipping.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -1165,15 +1165,15 @@ function Invoke-DbaDbLogShipping {

# Check if the backup job name is set
if ($BackupJob) {
$DatabaseBackupJob = "$BackupJob_$($db.Name)"
$DatabaseBackupJob = "$($BackupJob)$($db.Name)"
} else {
$DatabaseBackupJob = "LSBackup_$($db.Name)"
}
Write-Message -Message "Backup job name set to $DatabaseBackupJob" -Level Verbose

# Check if the backup job schedule name is set
if ($BackupSchedule) {
$DatabaseBackupSchedule = "$BackupSchedule_$($db.Name)"
$DatabaseBackupSchedule = "$($BackupSchedule)$($db.Name)"
} else {
$DatabaseBackupSchedule = "LSBackupSchedule_$($db.Name)"
}
Expand Down Expand Up @@ -1355,17 +1355,17 @@ function Invoke-DbaDbLogShipping {

# Check if the copy job name is set
if ($CopyJob) {
$DatabaseCopyJob = "$CopyJob_$SourceServerName_$($db.Name)"
$DatabaseCopyJob = "$($CopyJob)$($db.Name))"
} else {
$DatabaseCopyJob = "LSCopy_$SourceServerName_$($db.Name)"
$DatabaseCopyJob = "LSCopy_$($SourceServerName)_$($db.Name)"
}
Write-Message -Message "Copy job name set to $DatabaseCopyJob" -Level Verbose

# Check if the copy job schedule name is set
if ($CopySchedule) {
$DatabaseCopySchedule = "$CopySchedule_$($db.Name)"
$DatabaseCopySchedule = "$($CopySchedule)$($db.Name)"
} else {
$DatabaseCopySchedule = "LSCopySchedule_$($db.Name)"
$DatabaseCopySchedule = "LSCopySchedule_$($SourceServerName)_$($db.Name)"
Write-Message -Message "Copy job schedule name set to $DatabaseCopySchedule" -Level Verbose
}

Expand All @@ -1390,17 +1390,17 @@ function Invoke-DbaDbLogShipping {

# Check if the restore job name is set
if ($RestoreJob) {
$DatabaseRestoreJob = "$RestoreJob_$SourceServerName_$($db.Name)"
$DatabaseRestoreJob = "$($RestoreJob)$($db.Name)"
} else {
$DatabaseRestoreJob = "LSRestore_$DestinationServerName_$($db.Name)"
$DatabaseRestoreJob = "LSRestore_$($SourceServerName)_$($db.Name)"
}
Write-Message -Message "Restore job name set to $DatabaseRestoreJob" -Level Verbose

# Check if the restore job schedule name is set
if ($RestoreSchedule) {
$DatabaseRestoreSchedule = "$RestoreSchedule_$($db.Name)"
$DatabaseRestoreSchedule = "$($RestoreSchedule)$($db.Name)"
} else {
$DatabaseRestoreSchedule = "LSRestoreSchedule_$($db.Name)"
$DatabaseRestoreSchedule = "LSRestoreSchedule_$($SourceServerName)_$($db.Name)"
}
Write-Message -Message "Restore job schedule name set to $DatabaseRestoreSchedule" -Level Verbose

Expand Down

0 comments on commit 3a3d03d

Please sign in to comment.