scheduled-tasks

How do I determine if a scheduled task was ran automatically or ran in a browser?

旧巷老猫 提交于 2020-01-03 03:24:07
问题 I am running some code as a scheduled task, setup in CF Administrator. Is there a way to tell in the code that the code ran as a scheduled task, whether it was ran by clicking the run icon in the CF Administrator scheduled task area, or whether it was called directly in a browser? Adding additional variables will not work? 回答1: From the test link in the CF admin If you're asking if you can identify the difference between a scheduled task being run manually by clicking the test link in the

Selenium - Using Windows Task Scheduler vs. command line

陌路散爱 提交于 2020-01-02 05:29:09
问题 I have a batch file that kicks off my Selenium script (written in Java), which uses the IEDriverServer. When I run that batch file from the command line, the script works as expected. However, when I use the Windows Task Scheduler to run the exact same batch file, the script times out during a WebDriverWait until statement: (new WebDriverWait(driver, JAVASCRIPT_TIMEOUT_SECONDS)).until(new ExpectedCondition<Boolean>() { public Boolean apply(WebDriver d) { return d.getTitle().equals(BROWSE_PAGE

Azure - queueing time based tasks

柔情痞子 提交于 2020-01-02 04:58:12
问题 My application that runs on Windows Azure processes incoming requests from a user (which are put into an Azure Queue) and assigns them to real-world people. The people have a certain amount of time to handle the request. If none of the people assigned handle the request, I need to move on to a new set of people. Basically, I want to queue these tasks to be handled at a certain time, and then handle them again. If one of the users handles the task, I need to dequeue it so it isn't handled

Laravel 5 Command Scheduler, How to Pass in Options

痴心易碎 提交于 2020-01-02 02:21:10
问题 I have a command that takes in a number of days as an option. I did not see anywhere in the scheduler docs how to pass in options. Is it possible to pass options in to the command scheduler? Here is my command with a days option: php artisan users:daysInactiveInvitation --days=30 Scheduled it would be: $schedule->command('users:daysInactiveInvitation')->daily(); Preferably I could pass in the option something along the lines of: $schedule->command('users:daysInactiveInvitation')->daily()-

PHP and scheduled tasks

给你一囗甜甜゛ 提交于 2020-01-01 16:55:14
问题 I'm trying to come up with a list of different approaches to run scheduled tasks on PHP. My intention is to provide an universal way to run scheduled tasks in PHP. So far I have: 1) Analyze site traffic. If you receive 770 hits a day (which is one hit per 2 minutes), and you scheduled a task to run at 6:00 AM and a visitor requested a page at 5:59 AM, then run the task because the next visitor will arrive in 6:01 AM on average. Run = exec('/usr/bin/php -f /home/account/cron.php') in this case

Quartz Scheduler - What is the diff between RAM and JDBC Job store

若如初见. 提交于 2020-01-01 09:40:56
问题 I want to use Quartz Scheduler framework in my application. I came across two types of JobStores: 1) RAM Job Store 2) JDBC Job store. I am wondering in which case I have to use which job store. And what is the pros and cons between them. Any thoughts on this is really helpful for me and I appreciate it. 回答1: JDBC job store saves information about fired triggers and jobs in the database, thus: it won't lose firings if application was down when trigger was suppose to fire (this depends on

Is Spring's built in Scheduler persistent.?

*爱你&永不变心* 提交于 2020-01-01 04:51:06
问题 I have run into a case where I have to use a persistent Scheduler , since I have a web application that can crash or close due to some problems and might lose it job details if this happens . I have tried the following: Use Quartz scheduler : I used RAMJobStore first, but since it isn't persistent, it wasn't of much help. Can't setup JDBCJobStore because, this will require huge code changes to my existing code base. In light of such a scenario, I have the following queries: If I use Spring's

How to make sure only one instance of a Bash script is running at a time?

给你一囗甜甜゛ 提交于 2020-01-01 02:34:30
问题 I want to make a sh script that will only run at most once at any point. Say, if I exec the script then I go to exec the script again, how do I make it so that if the first exec of the script is still working the second one will fail with an error. I.e. I need to check if the script is running elsewhere before doing anything. How would I go about doing this?? The script I have runs a long running process (i.e. runs forever). I wanted to use something like cron to call the script every 15mins

Windows Task Scheduler - Run only during window of time

时光怂恿深爱的人放手 提交于 2019-12-31 17:49:38
问题 I have a task already set up in the Windows Scheduler (on Win Server 2008). It works great but it can put a burden on the system during peak hours (when the box is being used for other things). I currently run the job every 15 minutes. Can Task Sch. be setup to run every 15 minutes but only during a certain window of time. So I could set it up to run every 15 min, but only from 5pm to 5am -- and not run at all from 5am to 5pm? 回答1: Set a daily schedule starting at 5pm. In the Advanced dialog,

Task scheduler cannot open batch file when set to run whether user is logged on or not

≯℡__Kan透↙ 提交于 2019-12-31 12:23:34
问题 OS: Windows Server 2008 R2 Enterprise I am unable to get the Task Scheduler to run .bat files while I am logged off. I have a a production .bat file I want to use, but for my troubleshooting purposes I am using C:\Users\Administrator\Desktop\test.bat test.bat is very simple. All it contains is: taskkill /im notepad.exe It runs successfully on its own. If I have Notepad open and I double-click test.bat then the cmd window flashes and Notepad dies. The .bat file is not the problem. The task I