airflow - 气流任务调度器
问题描述
我的要求是从每周日晚上 9 点到周五晚上 9 点每 5 分钟安排一次 dag 任务。谁能帮我实现这一点。
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': datetime(2019,4,13,21,0),
'email': [],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
# 'retry_delay': timedelta(minutes=5),
# 'queue': 'bash_queue',
# 'pool': 'backfill',
# 'priority_weight': 10,
# 'end_date': datetime(2016, 1, 1),
}
dag = DAG(
'EUR_USD', catchup=False, default_args=default_args )
# Define the task that prints hello with the bash operator.
t1 = BashOperator(
task_id='FxScheduler',
schedule_interval="*/5 * * * 1-5",
bash_command='sh Hello.sh ',
dag=dag
)
我已经使用了上面的代码,我怎么能提到这个任务必须在周五晚上 9 点停止,而它又必须在周日晚上 9 点开始?
解决方案
我认为您可以参考此wiki 页面。
时间表应为“*/5 * * * 0-5”。
推荐阅读
- express - 为什么我的 POST 请求响应中没有数据?
- java - WebDriver 在一定时间后关闭弹出窗口
- javascript - 使用 decodeURIComponent 拦截 ajax 请求导致特殊字符
- algorithm - 安排两组人之间访谈的算法
- mongodb - 处理删除具有关系字段的文档
- c - 从普通指针中减去 NULL 指针会生成算术右移
- delphi - 如何获取我的电脑虚拟文件夹路径?
- c# - Linq select - 处理将抛出越界异常的情况
- oracle - 作为关键字/值符号输入 => 在 Oracle 中的输入值列表
- sass - 如何包含具有给定参数的 sass 文件