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
a6ea12fd
Commit
a6ea12fd
authored
Aug 28, 2019
by
唐香港
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update clear_tasks_container_logs.py
parent
1ae1756e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
clear_tasks_container_logs.py
dags/airflow/clear_tasks_container_logs.py
+3
-3
No files found.
dags/airflow/clear_tasks_container_logs.py
View file @
a6ea12fd
...
@@ -9,7 +9,7 @@ import os,logging
...
@@ -9,7 +9,7 @@ import os,logging
default_args
=
{
default_args
=
{
'owner'
:
'tangxianggang'
,
'owner'
:
'tangxianggang'
,
'depends_on_past'
:
False
,
'depends_on_past'
:
False
,
'start_date'
:
datetime
.
now
()
-
timedelta
(
days
=
1
),
'start_date'
:
datetime
.
now
()
-
timedelta
(
minutes
=
1445
),
'retries'
:
2
,
'retries'
:
2
,
'retry_delay'
:
timedelta
(
seconds
=
5
)
'retry_delay'
:
timedelta
(
seconds
=
5
)
}
}
...
@@ -17,11 +17,11 @@ default_args = {
...
@@ -17,11 +17,11 @@ default_args = {
dag
=
DAG
(
dag
=
DAG
(
dag_id
=
'clear_tasks_container_logs'
,
dag_id
=
'clear_tasks_container_logs'
,
default_args
=
default_args
,
default_args
=
default_args
,
schedule_interval
=
timedelta
(
minutes
=
720
)
schedule_interval
=
timedelta
(
minutes
=
1445
)
)
)
def
clear_worker_logs
():
def
clear_worker_logs
():
dt
=
datetime
.
now
()
-
timedelta
(
minutes
=
720
)
dt
=
datetime
.
now
()
-
timedelta
(
minutes
=
1445
)
time_str
=
dt
.
strftime
(
'
%
Y-
%
m-
%
d'
)
time_str
=
dt
.
strftime
(
'
%
Y-
%
m-
%
d'
)
cmd
=
'rm -rf /opt/bitnami/airflow/logs/*/*/
%
s*'
%
(
time_str
)
cmd
=
'rm -rf /opt/bitnami/airflow/logs/*/*/
%
s*'
%
(
time_str
)
logging
.
info
(
'exec cmd : '
+
cmd
)
logging
.
info
(
'exec cmd : '
+
cmd
)
...
...
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