This feature is scoped at the site collection level. When the feature activated, the timer job is created in the web application with a generic name that includes the site collection URL that it's supposed to run in. In theory, when deactivating the feature in a site collection, it stops executing there, but any other timer job feature activated on a different site collection would still run.
using Microsoft.SharePoint
using Microsoft.SharePoint.Administration
class DailyAlerts() : SPJobDefinition
{
public DailyAlerts() : base() { }
public DailyAlerts(string jobName, SPWebApplication webApp) : base(jobName, webApp, null, SPJobLockType.Job)
{
this.Title = jobName;
}
public override void Execute(Guid targetInstanceId)
{
// CHANGE THE SITE COLLECTION'S ROOT WEB SITE DESCRIPTION TO THE CURRENT TIME
}
}
After deploying the solution, and activating it on one site collection, the job never executed any custom code. This article helped remedy that: http://www.wahidsaleemi.com/2009/08/sharepoint-timer-jobs-not-running/. After stopping the SP timer server, deleting the cached XML files, and started the service, the activated site collection timer job executed perfectly.
However activating the custom timer feature on a different site collection, caused the same initial problem of that particular site collection's timer job not executing. The first timer job (post clear cache) still works fine.
Since certain users have control can turn on/off features, you can see how this can get frustrating for people. When new site collections are made, the feature will have to be activated, but it will not run until...the cache is cleared? What am I missing here?
Thanks in advance.