-
-
Notifications
You must be signed in to change notification settings - Fork 848
Open
Labels
Description
from email
Would it be possible to extend the command (Copy-DbaAgentJob ) to check the last modification date of an agent job on the primary and secondary replicas?
Something like:
If job not found on secondary replica à create it
If job found on secondary replica and last modification date is the same like on the primary à skip copy
If job found on secondary replica and last modification is older than on the primary à recreate job on secondary (delete / create)
The modification date could be found on [msdb].[dbo].[sysjobs]
SELECT [sJOB].[job_id] AS [JobID],
[sJOB].[name] AS [JobName],
[sJOB].[date_modified] AS [JobLastModifiedOn]
FROM [msdb].[dbo].[sysjobs] AS [sJOB];
That would be really cool and helpful.