romsharon98 commented on code in PR #36050:
URL: https://github.com/apache/airflow/pull/36050#discussion_r1413867730


##########
scripts/docker/clean-logs.sh:
##########
@@ -35,7 +35,7 @@ while true; do
     -type f -mtime +"${RETENTION}" -name '*.log' -print0 | \
     xargs -0 rm -f
 
-  find "${DIRECTORY}"/logs -type d -empty -delete
+  trap find "${DIRECTORY}"/logs -type d -empty -delete ERR

Review Comment:
   This fix is simple and works but the disadvantage of it that every ERR is 
except here.
   There is other solution that will except the specific file not found 
exception:
   
   ```bash
   error_file=$(mktemp)
   find "${DIRECTORY}"/logs -type d -empty -delete
   
   if grep -q "No such file or directory" "$error_file"; then
       cat "$error_file"
       echo "Info: if you run with hight available scheduler probably the other 
scheduler already delete it"
   fi
   
   rm "$error_file"
   ```



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