Scenario can be read on My other Question
Further to that question, why would a web application has timer job definition that it hasn't been deployed to.
this is the code I am using for feature activation and also feature is web application based.
private const string TIMERJOB_NAME = "Timer Job A";
public override void FeatureActivated(SPFeatureReceiverProperties properties)
{
try
{
SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
if (webApp == null)
{
//logging
}
foreach (SPJobDefinition job in webApp.JobDefinitions)
{
if (job.Name == TIMERJOB_NAME)
{
job.Delete();
}
}
FeatureClass TimerJob = new FeatureClass (webApp);
SPMinuteSchedule schedule = new SPMinuteSchedule();
schedule.BeginSecond = 0;
schedule.EndSecond = 59;
schedule.Interval = 5;
TimerJob.Schedule = schedule;
TimerJob.Update();
}
catch (Exception ex)
{
//logging
}
}

