Timer jobs are an effective solution to handle a situation where a specific process needs to run periodically. The following steps describe how to debug a Microsoft SharePoint 2010 timer job using Visual Studio.
1. Deploy your solution containing your timer job to SharePoint by clicking Build and then Deploy Solution
2. Open the Control Panel. Click System and Security, click Administrative Tools and then open Windows Services.
3. Select the service named SharePoint 2010 Timer and ensures that it’s running.
4. From Visual Studio, select Debug and Attach to Process and attach the debugger to the process named OWSTIMER.EXE. N.B In case you don’t see that process, tick the checkbox Show processes from all users.
5. Open the Central Administration. Click on Monitoring and then select Review job definitions to see a list of all time jobs.
6. Select your timer job and click Run Now
Your timer job will now execute and will hit any breakpoints you have set within Visual Studio.