Skip to content

Commit

Permalink
feat: remove empty log folders when cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ckljohn authored and potiuk committed Aug 10, 2023
1 parent 7d87d71 commit 2b8be05
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -1090,6 +1090,9 @@ while true; do
-type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
xargs -0 rm -f

find "${DIRECTORY}"/logs \
-type d -mtime +"${RETENTION}" -empty -delete

seconds=$(( $(date -u +%s) % EVERY))
(( seconds < 1 )) || sleep $((EVERY - seconds - 1))
sleep 1
Expand Down
3 changes: 3 additions & 0 deletions scripts/docker/clean-logs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ while true; do
-type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
xargs -0 rm -f

find "${DIRECTORY}"/logs \
-type d -mtime +"${RETENTION}" -empty -delete

seconds=$(( $(date -u +%s) % EVERY))
(( seconds < 1 )) || sleep $((EVERY - seconds - 1))
sleep 1
Expand Down

0 comments on commit 2b8be05

Please sign in to comment.