SharePoint - How setting the frequency of a custom timer job

Asked By Pasqual
03-Oct-08 05:51 AM
I have created a my custom timer job and deployed it as feature.
Inside Timer Job Definitions page of SP Central Administration I can see my
timer job with a schedule type as Minutes, but I want that it runs daily.
How can change the frequency of my custom timer job without creating an aspx
form?
Thank
SPMinuteSchedule
(1)
SPHourlySchedule
(1)
SPDailySchedule
(1)
SPJobDefinition
(1)
SharePoint
(1)
HourlySchedule.BeginMinute
(1)
MinuteSchedule.BeginSecond
(1)
DailySchedule.BeginSecond
(1)
  Bryan Phillips (MVP) replied...
03-Oct-08 09:30 PM
You need to update the Schedule property of the SPJobDefinition to the
appropriate class.

For scheduling daily, use code like this:

SPDailySchedule dailySchedule = new SPDailySchedule();
dailySchedule.BeginHour = 0;
dailySchedule.BeginMinute = 0;
dailySchedule.BeginSecond = 0;
dailySchedule.EndHour = 23;
dailySchedule.EndMinute = 59;
dailySchedule.EndSecond = 59;

job.Schedule = dailySchedule;

That tells SharePoint to run the job any time between 00:00:00 (12:00
AM) and 23:59:59 (11:59 PM) each day.  You can make this window shorter
if you need to schedule it during off-peak hours.

You can also run the job hourly using this code:

SPHourlySchedule hourlySchedule = new SPHourlySchedule();
hourlySchedule.BeginMinute = 0;
hourlySchedule.EndMinute = 59;

job.Schedule = hourlySchedule;

Or every X number of minutes using this code:

SPMinuteSchedule minuteSchedule = new SPMinuteSchedule();
minuteSchedule.BeginSecond = 0;
minuteSchedule.EndSecond = 59;
minuteSchedule.Interval = X;

job.Schedule = minuteSchedule;

The Interval is only available on the SPMinuteSchedule class.  Setting
it to 15 will run the job every 15 minutes for example.



--
Bryan Phillips
MCT, MCSD, MCDBA, MCSE
Microsoft MVP - Client Application Development
Blog:  http://bphillips76.spaces.live.com
Web Site:  http://www.composablesystems.net
  eliza sahoo replied to Pasqual
28-Jun-10 09:37 AM
When we want to run a task (like sending emails or deleting the list items etc. . .  )  in Daily basis or in Hourly basis then we can use a Timer job to this task .To see the  timer job you can move to the Central Administrations then click on the operations tab,  then in the Global Configuration section you can see the Timer job status and timer job definition. In timer job definition you can get the details of the timer job i.e.  the  title , the web application to which it is attached   and the schedule type i.e.  Daily, Weekly or hourly basis. To get the status of the timer job go to the timer job status, here you can view status.



http://www.mindfiresolutions.com/Sharepoint-Support.htm
Create New Account
help
Moving to SharePoint - Advice? SharePoint I have had several clients ask about putting their Access database on the web. So the inevitable any longer: I am going to have to get up to speed on SharePoint - specifically as it relates to porting Access 2010 dbs and linking the two. Any advice other resources that might be helpful. Also, I imagine I will have to purchase some SharePoint hosting for development and testing, correct? Anyone have any recommendations for inexpensive hosts for single-person developers? Thanks in advance for any assistance! SharePoint Discussions SQL Server (1) Windows XP (1) Active Directory (1 SharePoint 2010 (1) SharePoint (1) Access 2010 (1) Windows 7 (1) Oracle (1) eb. ve or You will need to work with access services in SharePoint 2010. The configuration related information is available at: http: / / technet.microsoft.com / en-us / library
Sharepoint 2010 on Windows XP? SharePoint I am a developer wanting to learn Sharepoint. Last Saturday, I met a .NET architect that told me the new version of Sharepoint (version 2010) was designed to run on a desktop computer running Windows (not Windows Server I am still using Windows XP SP3. Can I install the trial version of Sharepoint 2010 on my Windows XP? Will Sharepoint 2010 work on Windows XP? SharePoint Setup Discussions SQL Server 2008 (1) SQL Server (1) Windows Server 2008 R2 (1) SharePoint Server 2010 (1) Windows XP (1) SharePoint 2010 (1) Windows Server (1) Windows Vista (1
What do I need? SharePoint New to SharePoint and we are starting out with 2010. I have just upgraded my Visual Studio to x86 boxes? What else to I need? Any help would be greatly appreciated. Sincerely, Glen Sharepoint Windows Services Discussions Visual Studio (1) SharePoint (1) MOSS 2007 (1) Microsoft SharePoint (1) Encoding (1) SP development (1) Difference (1) SP server (1) - -- -- - = _NextPart_0001_9BAC5087 Content-Type: text plain Content-Transfer-Encoding: 7bit Hi Glen, Just like sharepoint 3.0 which provides WSS 3.0 and MOSS 2007 for different hosting purpose. The sharepoint 2010 provides two products: Sharepont foundation 2010 and sharepoint server 2010. The sharepoint foundation is the same as WSS 3.0 which is a
Newbie to Sharepoint, got dumped someone else's code base SharePoint Hi. . . Our company's marketing people hired out a contractor to develop some Sharepoint extensions for our product and they did not involve the in-house engineers at all gone and they have dumped the pile on us, but no one here has done Sharepoint before. I have been searching around and I found VS extensions for Sharepoint 1.3, which I installed hoping that I could make sense of the .wsp file for VSeSP 1.3 say it is supposed to add all kinds of commands for Sharepoint things to VS, but I have not found any of them. I had VS 2008 see any of the new options there either. Any hints to the newbie? thanks Mark SharePoint Portal Server Dev Discussions Hi Mark MSDN subscribers (1) SharePoint 2010 (1) SharePoint (1) Microsoft MSDN (1) MSDN subscribers (1) IIS (1) Mark NextPart (1
can we configure kerberos after installing sharepoint 2010 on web SharePoint Hi We installed SharePoint 2010 on a small web farm (2 servers) without following the setup instructions. we are the double hop issue. the setup guide says that we should configure kerberos before installing sharepoint, but we cannot go back right now. can we configure kerberos after installing sharepoint 2010 on web farm? SharePoint Setup Discussions SharePoint Server 2010 (1) SharePoint 2010 (1) SharePoint (1) NET Framework (1) App Pool (1) IIS Web (1) IIS (1