This is an automated email from the ASF dual-hosted git repository.
potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 93c3ccbdf2 feat: remove empty log folders when cleanup (#33252)
93c3ccbdf2 is described below
commit 93c3ccbdf2e60a7c3721ce308edae8b6591c9f23
Author: John Cheng <[email protected]>
AuthorDate: Mon Aug 14 06:10:53 2023 +0800
feat: remove empty log folders when cleanup (#33252)
* feat: remove empty log folders when cleanup
* remove mtime
---
Dockerfile | 2 ++
scripts/docker/clean-logs.sh | 2 ++
2 files changed, 4 insertions(+)
diff --git a/Dockerfile b/Dockerfile
index 8bd6465381..b92a5d2849 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1090,6 +1090,8 @@ while true; do
-type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
xargs -0 rm -f
+ find "${DIRECTORY}"/logs -type d -empty -delete
+
seconds=$(( $(date -u +%s) % EVERY))
(( seconds < 1 )) || sleep $((EVERY - seconds - 1))
sleep 1
diff --git a/scripts/docker/clean-logs.sh b/scripts/docker/clean-logs.sh
index 0c775b14e6..53f5407d96 100644
--- a/scripts/docker/clean-logs.sh
+++ b/scripts/docker/clean-logs.sh
@@ -35,6 +35,8 @@ while true; do
-type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
xargs -0 rm -f
+ find "${DIRECTORY}"/logs -type d -empty -delete
+
seconds=$(( $(date -u +%s) % EVERY))
(( seconds < 1 )) || sleep $((EVERY - seconds - 1))
sleep 1