scheduling

Recommended method for loading a URL via a scheduled task on Windows

北城以北 提交于 2019-11-26 05:16:24
问题 I have a webpage hosted on a Windows box that I need to assure gets loaded at least once/day. My current plan is to create a scheduled task that opens Internet Explorer and hits the URL: \"C:\\Program Files\\Internet Explorer\\iexplore.exe\" myurl.com/script_to_run_daily.aspx This was simple to setup and works fine, but it strikes me as a hack because Internet Explorer actually has to open and hit this URL. I don\'t need any input back from this page, it simply stores cached data in files

How might I schedule a C# Windows Service to perform a task daily?

五迷三道 提交于 2019-11-26 01:42:34
问题 I have a service written in C# (.NET 1.1) and want it to perform some cleanup actions at midnight every night. I have to keep all code contained within the service, so what\'s the easiest way to accomplish this? Use of Thread.Sleep() and checking for the time rolling over? 回答1: I wouldn't use Thread.Sleep(). Either use a scheduled task (as others have mentioned), or set up a timer inside your service, which fires periodically (every 10 minutes for example) and check if the date changed since

Java thread affinity

淺唱寂寞╮ 提交于 2019-11-26 01:39:30
问题 Does anybody know of a way to lock down individual threads within a Java process to specific CPU cores (on Linux)? I\'ve done this in C, but can\'t find how to do this in Java. My instincts are that this will require a JNI call, but I was hoping someone here might have some insight or might have done it before. Thanks! 回答1: You can't do this in pure java. But if you really need it -- you can use JNI to call native code which do the job. This is the place to start with: http://ovatman.blogspot

PHP: running scheduled jobs (cron jobs)

[亡魂溺海] 提交于 2019-11-25 23:47:21
问题 I have a site on my webhotel I would like to run some scheduled tasks on. What methods of achieving this would you recommend? What I’ve thought out so far is having a script included in the top of every page and then let this script check whether it’s time to run this job or not. This is just a quick example of what I was thinking about: if ($alreadyDone == 0 && time() > $timeToRunMaintainance) { runTask(); $timeToRunMaintainance = time() + $interval; } Anything else I should take into

Java Timer vs ExecutorService?

拥有回忆 提交于 2019-11-25 21:56:08
问题 I have code where I schedule a task using java.util.Timer . I was looking around and saw ExecutorService can do the same. So this question here, have you used Timer and ExecutorService to schedule tasks, what is the benefit of one using over another? Also wanted to check if anyone had used the Timer class and ran into any issues which the ExecutorService solved for them. 回答1: According to Java Concurrency in Practice: Timer can be sensitive to changes in the system clock,

What is the Windows version of cron? [closed]

隐身守侯 提交于 2019-11-25 21:48:59
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 10 months ago . A Google search turned up software that performs the same functions as cron, but nothing built into Windows. I\'m running Windows XP Professional, but advice for any version of Windows would be potentially helpful to someone. Is there also a way to invoke this feature (which based on answers is called the Task

VBA Macro On Timer style to run code every set number of seconds, i.e. 120 seconds

北慕城南 提交于 2019-11-25 19:27:14
I have a need to run a piece of code every 120 seconds. I am looking for an easy way to do this in VBA. I know that it would be possible to get the timer value from the Auto_Open event to prevent having to use a magic number, but I can't quite get how to fire off a timer to get something to run every 120 seconds. I don't really want to use an infinite loop with a sleep if I can avoid it. EDIT : Cross-post based on an answer provided is at: Excel VBA Application.OnTime. I think its a bad idea to use this... thoughts either way? When the workbook first opens, execute this code: alertTime = Now +