I need to disable a custom timer job when deactivating a feature and must run the timer job on activating the feature in SharePoint 2010. Can you please help me with the code or blogs or pointers.
Within your feature receiver you can set the SPJobDefinition property isDisabled to get/set whether it is enabled.
To run the job during activation you call the RunNow method.
Here is a link to the SPJobDefinition Members - http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spjobdefinition_members.aspx