public class TaskListTimerEventReceiver : SPFeatureReceiver
    {
        // Uncomment the method below to handle the event raised after a feature has been activated.
        const string jobName = "Task list timer job";
        public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
                DeleteExistingJob(jobName, webApp);
                CreateJob(jobName, webApp);
            });


        }

        private void CreateJob(string jobName, SPWebApplication webApp)
        {
            NotificationTimerJob timer1 = new NotificationTimerJob(jobName, webApp);
            SPMinuteSchedule minuteschedule=new SPMinuteSchedule();
            minuteschedule.BeginSecond = 0;
            minuteschedule.EndSecond = 59;
            minuteschedule.Interval = 5;
            timer1.Schedule = minuteschedule;
            timer1.Update();
        }

        private void DeleteExistingJob(string jobName, SPWebApplication webApp)
        {
            foreach (SPJobDefinition job in webApp.JobDefinitions)
            {
                if (job.Name == jobName)
                {
                    job.Delete();
                }
            }
         
        }


        // Uncomment the method below to handle the event raised before a feature is deactivated.

        public override void FeatureDeactivating(SPFeatureReceiverProperties properties)
        {
            lock(this)
                try
                {
                    SPSecurity.RunWithElevatedPrivileges(delegate()
                    {
                        SPWebApplication webApp = properties.Feature.Parent as SPWebApplication;
                        DeleteExistingJob(jobName, webApp);
                    }
                    );
                }
                catch
                {
                }
        }