scheduled-tasks

Spring - Scheduled Task - Graceful Shutdown

我的未来我决定 提交于 2020-05-29 03:12:24
问题 I have a Spring-Boot application with a bean running a scheduled task at about 1 minute intervals, and this bean has a @PreDestroy method. Is there a solution for allowing a task which is currently being executed to complete - or at least given some time to complete - before the life cycle reaches the pre-destroy phase? 回答1: You need update configuration of ThreadPoolTaskScheduler . Set true for waitForJobsToCompleteOnShutdown (method setWaitForTasksToCompleteOnShutdown ). From documentation:

How do I check when my next Airflow DAG run has been scheduled for a specific dag?

拟墨画扇 提交于 2020-05-27 02:58:18
问题 I have airflow set up and running with some DAGs scheduled for once a day "0 0 * * *". I want to check when is the next time a specific dag has been scheduled to run, but I can't see where I can do that within the admin. 回答1: If you want you use the Airflow 's CLI , there's next_execution option Get the next execution datetime of a DAG. airflow next_execution [-h] [-sd SUBDIR] dag_id UPDATE-1 If you need to do it programmatically (within an Airflow task ), you can refer to next_execution(..)

Can you trigger an AWS Lambda on a dynamic timer?

半城伤御伤魂 提交于 2020-05-24 20:38:26
问题 Is there a way to trigger an AWS Lambda on a dynamic timer? Currently, I am utilizing scheduled-events to trigger the lambda, but this is a set timer. Is there a way to dynamically set a time for the Lambda to be triggered from within the Lambda? The idea here is that this Lambda does specific checks and executes code to know when it should run next (because I only want this lambda to run when it needs to). I want to 1) determine the next time it needs to run and 2) set the time from within

Can you trigger an AWS Lambda on a dynamic timer?

会有一股神秘感。 提交于 2020-05-24 20:37:06
问题 Is there a way to trigger an AWS Lambda on a dynamic timer? Currently, I am utilizing scheduled-events to trigger the lambda, but this is a set timer. Is there a way to dynamically set a time for the Lambda to be triggered from within the Lambda? The idea here is that this Lambda does specific checks and executes code to know when it should run next (because I only want this lambda to run when it needs to). I want to 1) determine the next time it needs to run and 2) set the time from within

change registry value for currently logged in Windows user, when running script as SYSTEM user (batch)

匆匆过客 提交于 2020-04-17 20:24:28
问题 I have this code in a batch script. REG ADD HKEY_CURRENT_USER\MyKey /ve /t REG_DWORD /d 1 /f The problem is the script is run using the system account as a scheduled task in Windows. When using the system account to run the task it does not apply the value to the currently logged in Windows user's registry. I could not find a way to set the task to use the currently logged in user, so had to set it to use the system account. I attempted to use this solution; however it does not apply to the

change registry value for currently logged in Windows user, when running script as SYSTEM user (batch)

故事扮演 提交于 2020-04-17 20:15:06
问题 I have this code in a batch script. REG ADD HKEY_CURRENT_USER\MyKey /ve /t REG_DWORD /d 1 /f The problem is the script is run using the system account as a scheduled task in Windows. When using the system account to run the task it does not apply the value to the currently logged in Windows user's registry. I could not find a way to set the task to use the currently logged in user, so had to set it to use the system account. I attempted to use this solution; however it does not apply to the

Use 7-Zip to Compress folders within a directory and then delete the source folder used to create the .zip file

亡梦爱人 提交于 2020-04-16 08:31:05
问题 I need to run a script to compress all folders within a folder that is 2 levels within a directory structure. I want the script to compress all folders within the log folder and then delete the original folder, thus saving loads on space. To illustrate the folders I wish to compress, see below: Drive Location-->machinename-->logtype-->folders_i_want_to_compress Within folder 2 there are folders with dates in the format yyyymmdd and it is these that I wish to compress as zip files. I cannot

Run a scheduled task from web application

断了今生、忘了曾经 提交于 2020-03-18 07:00:29
问题 I am using the following code to execute a Windows Scheduled Task from my web application. Both the web application and the scheduled application runs on the same server. var proc = new Process { StartInfo = { UseShellExecute = false, FileName = @"C:\Windows\System32\schtasks.exe", Arguments = "/run /tn StartDataSync", UserName = "admin123", Password = passwd } }; proc.Start(); proc.WaitForExit(); Now I would like to run the same scheduled application from a web application running on another

Powershell script not running on scheduled task

柔情痞子 提交于 2020-03-16 07:39:11
问题 I can run the script outside and inside the Task Scheduler. But the scheduled tasks will not run the script automatically when triggered. I have tried configuring the Local Security Policies by changing, User Account Control: Admin Approval Mode for the Built-i Administrator account (Not Defined) - User Account Control: Run all administrators in Admin Approval Mode (Disabled) - User Account Control: Behavior of the elevation prompt for administrators in Admin Approval Mode (Elevate without

Windows Task Manager Schedule VBA Macro to Send An Email Using OutLook Daily Running Manually and Not Automatically

拈花ヽ惹草 提交于 2020-03-03 10:11:09
问题 I have my macro which is running, & for this I created a vb script and used windows task manager to schedule its run every day. Whenever I run manually or attempt changing the time in the trigger, I always make sure that both excel and outlook are not running. If I run the macro in Excel VBA, it sends the email. After scheduling the task to run everyday, just as a test if I go to (in TaskScheduler) View -> Hidden Tasks and manually click Run, it sends the email. However, if I schedule it to