potiuk commented on code in PR #37222:
URL: https://github.com/apache/airflow/pull/37222#discussion_r1481603016


##########
Dockerfile:
##########
@@ -1181,10 +1181,14 @@ echo "Cleaning logs every $EVERY seconds"
 
 while true; do
   echo "Trimming airflow logs to ${RETENTION} days."
-  find "${DIRECTORY}"/logs \
+ 
+  files=$(find "${DIRECTORY}"/logs \
     -type d -name 'lost+found' -prune -o \
-    -type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
-    xargs -0 rm -f
+    -type f -mtime +"${RETENTION}" -name '*.log' || true)
+ 
+  for file in ${files}; do

Review Comment:
   This will not work if there are spaces in file names (which might happen) 
better to keep -print0 / xargs -0 and ignore errors there.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to