{"id":1073,"date":"2012-11-24T07:38:51","date_gmt":"2012-11-24T07:38:51","guid":{"rendered":"https:\/\/poiseddevelopers.com\/reality-tech\/?p=1073"},"modified":"2024-05-13T10:52:53","modified_gmt":"2024-05-13T10:52:53","slug":"timer-job-history","status":"publish","type":"post","link":"https:\/\/poiseddevelopers.com\/reality-tech\/timer-job-history\/","title":{"rendered":"Timer Job History"},"content":{"rendered":"<h2>Timer Job History<\/h2>\n<p>SharePoint maintains a timer job history by default for seven days. You can see the current duration:<\/p>\n<pre lang=\"php\">  \r\n$TJ = Get-SPTimerJob | Where-Object {$_.name -eq \"job-delete-job-history\"}\r\n$TJ.daystokeephistory\r\n<\/pre>\n<p>If you\u2019d like to know when the job last ran just run:<\/p>\n<p>$TJ.get_LastRunTime()<\/p>\n<p>If you want to reduce the days to retain history, here\u2019s how:<\/p>\n<pre lang=\"php\">  $TJ.set_DaysToKeepHistory(3)\r\n  $TJ.update()<\/pre>\n<p>I suggest changing the cleanup frequency to run daily, to reduce periodic growth.<\/p>\n<p>Occasionally the Timer Job History grows to the point where it needs to be gradually cleaned. You can use the technique I outline in this article to gradually cull the timer job history:<br role=\"presentation\" data-uw-rm-sr=\"\" \/><a href=\"https:\/\/reality-tech.com\/sync-db-grows-indefinitely\/\" target=\"_blank\" rel=\"noopener\">sync db grows indefinitely<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>You can also review Timer Job history via SQL against the farm DB:<\/p>\n<pre lang=\"php\"> SELECT TOP 1000\r\n[Status]\r\n ,[StartTime]\r\n ,[EndTime]\r\n ,[WebApplicationName]\r\n ,[JobTitle]\r\n ,[ServerName]\r\n ,[DatabaseName]\r\n ,[ErrorMessage]\r\n FROM [SharePoint_2013_Farm].[dbo].[TimerJobHistory]\r\n \r\n where CHARINDEX('text you know is in the job name',JobTitle) &gt; 0\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Timer Job History SharePoint maintains a timer job history by default for seven days. You can see the current duration: $TJ = Get-SPTimerJob | Where-Object {$_.name -eq &#8220;job-delete-job-history&#8221;} $TJ.daystokeephistory If you\u2019d like to know when the job last ran just run: $TJ.get_LastRunTime() If you want to reduce the days to retain history, here\u2019s how: $TJ.set_DaysToKeepHistory(3) [&hellip;]<\/p>\n","protected":false},"author":12,"featured_media":1075,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[26],"tags":[],"class_list":["post-1073","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"_links":{"self":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1073","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/comments?post=1073"}],"version-history":[{"count":7,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1073\/revisions"}],"predecessor-version":[{"id":3966,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/posts\/1073\/revisions\/3966"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media\/1075"}],"wp:attachment":[{"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/media?parent=1073"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/categories?post=1073"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/poiseddevelopers.com\/reality-tech\/wp-json\/wp\/v2\/tags?post=1073"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}