如何在每3个小时后执行一次计时器服务,每天一次以编程方式执行 [英] how to execute timer services after every 3 hours and once per day programatically
问题描述
我使用事件接收器成功设计和部署了定时器服务,事件接收器每15分钟后执行一次,如
I have designed and deployed timer services successfully using event receiver which executes after every 15 min like
CalculateRegisteredDays job = new CalculateRegisteredDays(JobName,site);
SPMinuteSchedule schedule = new SPMinuteSchedule();
schedule.BeginSecond = 0;
schedule.EndSecond = 59;
schedule.Interval = 15;
job.Schedule = schedule;&
job.Update();
CalculateRegisteredDays job = new CalculateRegisteredDays(JobName, site);
SPMinuteSchedule schedule = new SPMinuteSchedule();
schedule.BeginSecond = 0;
schedule.EndSecond = 59;
schedule.Interval = 15;
job.Schedule = schedule;
job.Update();
2要求
1)我想在每3小时或2小时后执行计时器服务
1) I want to execute timer services after every 3 hours or 2 hours
2)还希望其他计时器服务每天执行一次
2) also want other timer service to execute once per Day
谢谢
推荐答案
您好qasimidl,
Hi qasimidl,
以下脚本将有助于您可以在所有SP服务器中检查并启动计时器服务,如果您想每3小时执行一次计时器服务,最好的方法是将其放在任务计划程序中,并提及任务应该每3小时运行一次。以下链接
将帮助您在任务计划程序中创建任务。
the below script will help you to check and start timer service in all the SP servers and if you want to execute the timer service for every 3 hours the best way is to place it in the Task Scheduler and Mention the Task should run every 3 hours. Below link will help you to create a task in Task Scheduler.
farm = Get-SPFarm
farm = Get-SPFarm
FarmTimers =
FarmTimers =
这篇关于如何在每3个小时后执行一次计时器服务,每天一次以编程方式执行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!