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


##########
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:
   I was not aware spaces on file names are a possibility (does not happen on 
my case)
   Sure I thought of just ignoring errors on xargs rm, but I was afraid it 
would not solve all cases when the error appears on the find command.
   I will do the change though, it's better than nothing.



-- 
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