add workflow 服务器维护,dev
This commit is contained in:
parent
27bd1734fd
commit
c472ea063b
|
@ -0,0 +1,9 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
|
from maintain_log import delDir
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
"删除日志,保留1个月内做过修改的日志"
|
||||||
|
delDir(
|
||||||
|
"/data/airflow/logs/",30
|
||||||
|
)
|
|
@ -48,4 +48,15 @@ depends_on_past=False,
|
||||||
retries=3,
|
retries=3,
|
||||||
dag=dag)
|
dag=dag)
|
||||||
|
|
||||||
uds_maintain_data_file >> task_failed
|
|
||||||
|
uds_maintain_log = SSHOperator(
|
||||||
|
ssh_hook=sshHook,
|
||||||
|
task_id='uds_maintain_log',
|
||||||
|
command='python /data/airflow/etl/CTL/maintain_log.py >>/data/airflow/logs/maintain.log',
|
||||||
|
params={'my_param':"uds_maintain_log"},
|
||||||
|
depends_on_past=False,
|
||||||
|
retries=3,
|
||||||
|
dag=dag)
|
||||||
|
|
||||||
|
uds_maintain_data_file >> uds_maintain_log
|
||||||
|
uds_maintain_log >> task_failed
|
||||||
|
|
Loading…
Reference in New Issue