Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
airflow-dags-hub
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
唐香港
airflow-dags-hub
Commits
bb18102b
Commit
bb18102b
authored
Sep 18, 2019
by
唐香港
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update clear_tasks_container_logs.py
parent
945dc687
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
clear_tasks_container_logs.py
dags/airflow/clear_tasks_container_logs.py
+4
-1
No files found.
dags/airflow/clear_tasks_container_logs.py
View file @
bb18102b
...
...
@@ -6,6 +6,9 @@ from airflow.operators.python_operator import PythonOperator
from
datetime
import
datetime
,
timedelta
import
os
,
logging
logging
.
basicConfig
(
level
=
logging
.
INFO
)
logger
=
logging
.
getLogger
(
__name__
)
default_args
=
{
'owner'
:
'tangxianggang'
,
'depends_on_past'
:
False
,
...
...
@@ -24,7 +27,7 @@ def clear_worker_logs():
dt
=
datetime
.
now
()
-
timedelta
(
minutes
=
1445
)
time_str
=
dt
.
strftime
(
'
%
Y-
%
m-
%
d'
)
cmd
=
'rm -rf /opt/bitnami/airflow/logs/*/*/
%
s*'
%
(
time_str
)
logg
ing
.
info
(
'exec cmd : '
+
cmd
)
logg
er
.
info
(
'exec cmd : '
+
cmd
)
os
.
system
(
cmd
)
task
=
PythonOperator
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment