timer-jobs

Run function at set interval only at certain time of the day

 ̄綄美尐妖づ 提交于 2021-02-08 09:55:48
问题 I am currently running a function at regular interval round the clock. setInterval( function(){ do_this(); } , 1000*60); Unfortunately, this is not exactly what I want. I would like this function to be run at set regular interval from morning 0900hrs to 1800hrs only. The function should not run outside of these hours. How can this be done in node.js? Are there convenient modules or functions to use? 回答1: You can simply just check to see if the current time is within the desired time range or

How do you instruct a SharePoint Farm to run a Timer Job on a specific server?

左心房为你撑大大i 提交于 2020-01-13 09:42:51
问题 We have an SP timer job that was running fine for quite a while. Recently the admins enlisted another server into the farm, and consequently SharePoint decided to start running this timer job on this other server. The problem is the server does not have all the dependencies installed (i.e., Oracle) on it and so the job is failing. I'm just looking for the path of least resistance here. My question is there a way to force a timer job to run on the server you want it to? [Edit] If I can do it

How to show Failed status in Sharepoint Timer Job

筅森魡賤 提交于 2020-01-05 06:06:05
问题 I want my timer job to display failed status on certain condition. Should I just throw an exception or what? 回答1: Hasan, If an exception bubbles out of the code, it will indeed show a failed status. If you want to explicitly "fail" your run with the timer job instance, you can and should throw an exception out. This can be done in conjunction with setting the SPJobDefinition.Retry flag value to TRUE if you feel that another run through would get around your "problem condition." By the same

SharePoint Feature Activation Form

蹲街弑〆低调 提交于 2020-01-03 03:26:07
问题 I'd like to collect some information from a user when they activate a feature on a site. Just like the WF Association form when you add a workflow to a list. My particular scenario is a feature that creates a timer job that will do a weekly export of a document library as PDFs to a special staging database. When the feature is activated I'd like to ask the user for the connection string of the database, the source document library and the interval between updates. 回答1: I do not know of a way

Python periodic task inside an infinite loop

人走茶凉 提交于 2019-12-25 11:45:30
问题 I need to execute a piece of code inside a while True loop every, let's say, 5 seconds. I know the threading.Timer(5, foo).start() will be run every 5 seconds but my foo() function depends on a variable inside my while loop. The foo is actually run on another thread and I don't want to block the current thread just for timing's sake. +------------------------while #main-thread--------------------------------- | +..........foo(val)..........foo(val)...........foo(val)............foo(val) -5s-

'Activate feature' step error :Object Reference not set to an instance of an object

与世无争的帅哥 提交于 2019-12-24 17:07:16
问题 I created a custom timer job and implemented it through a feature event in sharepoint. when i tried to activate it, its showing this particular error: Object reference not set to an instance of an object. at TimerJobExample.MyFeatureReceiver.FeatureActivated(SPFeatureReceiverProperties properties) in C:\Documents and Settings\admin-shuklag.INFRADEV\My Documents\Visual Studio 2008\Projects\TimerJobExample\TimerJobExample\MyFeatureReceiver.cs:line 22 at Microsoft.SharePoint.SPFeature

Returning timer job status from custom timer job

别来无恙 提交于 2019-12-24 11:53:57
问题 There is a timer job status page in Central Admin /_admin/ServiceRunningJobs.aspx How can I properly return the status for my custom timer job ? The Execute() method of timer job returns void . 回答1: It either fails (Exception) or succeeds (Method completes) 回答2: SPJobDefinition.UpdateProgress 来源: https://stackoverflow.com/questions/4666101/returning-timer-job-status-from-custom-timer-job

Sharepoint Timer Job and log4net

二次信任 提交于 2019-12-24 06:45:20
问题 I'm developing a custom SharePoint solution which consist of a feature and a timer job (which is created by the feature in FeatureActivated). In my solution I want to use log4net for logging (I know about ULS). Everything is fine with log4net in the feature itself (just placed log4net.config near web.config and all is fine), but I have completely no idea how to initialize log4net from timer job (taking into account it is run not by IIS but by OSWTIMER). Can someone please help me finding

Manually start SharePoint timer job

末鹿安然 提交于 2019-12-22 06:40:34
问题 I'd like to invoke a timer job installed on a SharePoint server manually. What would be useful is something along the lines of an stsadm command. My scenario is, I've deployed a solution with a bunch of features to a customers server. I don't want to wait for the weekly schedule to kick a particular timer job to life. I would like to just punch in a command to get the specific job to run immediately. Obviously in the development enviroment I've got the schedule set for a few minutes but I

run a Java program in specific time

好久不见. 提交于 2019-12-18 09:53:06
问题 i need help to run my Java program on the server at a specific time like 2 pm (to index the new files). Someone told me that Java has some thing called jobs but I don't know how to work with that. I tried this: boolean cond=true; while(cond){ @SuppressWarnings("deprecation") int heur = new Date().getHours(); @SuppressWarnings("deprecation") int minute= new Date().getMinutes(); if(heur==16 && minute==02){ indexer.close(); end = new Date().getTime(); File f; cond=false; } But with this the