I have a small question on windows scheduler - Say i have scheduled a task to run once in 30 minutes interval in windows task scheduler.
Does windows start the second process even if my first job process has not finished yet? Or windows takes care of starting the second job process only after the first job is finished? Or do i have to take care of it explicitly?
Go to the Settings tab in the Create Task wizard (or editing the tasks’ Properties). There should be an entry If the task is already running, then the following entry applies: and you can choose one of the following options (push button):
Do not start a new instance - the first instance of the task continues to run.
Run a new instance in parallel - the first task instance continues to run and the new task instance also starts.
Queue a new instance - the new tasks instance runs after the first task instance finished.
Stop the existing instance - the first task instance is stopped and the new task instance is started.
Related
I try to run a task withoutOverlapping but the task still called every minute even if i add
->withoutOverlapping()
Here is my task i have a sleep(240) to force the task to be longer than 1 min but the mails is still sent every minutes
$schedule->call(function() {
$user = User::find(4);
Mail::to('john.doe#gmail.com')->queue(new AccountConfirmation($user));
sleep(240);
})->name('update_game')->withoutOverlapping(20);
I use heroku with a scheduler here are the logs : the task "update_game" run every minutes even if the task takes more than 1 minute (with the sleep(240)) i wonder why
The Heroku scheduler starts a brand new dyno (basically, a server) every time it runs.
->withoutOverlapping() only applies to the current server, so it's not doing anything, because the next minute another server is running.
You'll want to call ->onOneServer() too, but to do that, you'll need to move off the file driver onto something like redis for your caching system, or you'll have the same problem - one server not knowing anything about the other, because they each have their own set of files.
we are using AWX/Ansible Tower to launch playbooks on hosts. In our case we are always running the playbook targeting one host each time a job is launched (actually launching the job using the API)
Our problem:
- When a job fails, we'd like to offer as an option to our users the possibility to re-launch the job with ability to change the extra_variables used to execute the job. At the moment on the UI the extra variable seems to be read-only. Is there a way to change that or another way to re-launch a job using the UI and changing the variables (we obviously know that using the API we can relaunch a new instance of the job using a new set of extra_variables...) ?
Thx
Is there any way to start task after sometime when specific task starts?
Two answers:
Put the task in a batchfile, add a wait for 5 minutes and then put the next task.
In the task scheduler, instead of the task itself, refer to the batchfile.
I just see there's something called INotify cron (there's a tag icron for that). Maybe this can help you.
Please check this picture as following
I was looking at Window task scheduler to schedule my script to run each hour. The script will do some checks and will send an email .
I did not find options to schedule it for each 1 hour. I only found for every day, daily, weekly and so on.
Task scheduler does show the option to configure hourly trigger as shown below.
Another option you have is to run your PowerShell script as a Service and add the logic in your PowerShell script to trigger your main code once every hour.
Refer: Video: Running PowerShell scripts as a real Windows Service!
How To Create a User-Defined Service
Call it from scheduled task eg task would be to start PowerShell and run the specified script see Run a powershell script in the background once per minute
create the task then -> new trigger -> daily -> repeat task every hour is one way of doing it. Or do it on commandline
Is it possible for the windows task scheduler to read the return code of a batch script and to fire off a task based on the value of said return code? I have a batch script that:
copies files from one drive in server A to another drive in server B.
If server B is down it'll complete with a return code 1
and I want the task scheduler to see that return code of 1 and send an email saying there's something wrong with server B.
It's clear in the task scheduler it sees the return codes but I can't seem to find an option to use the return code.
Another idea I've thought about is have the task scheduler send an email if a task fails after starting up. But it appears even when the batch file returns a 1 for a failed copy, the task scheduler still marks the task as ran successfully.