16 lines
430 B
Bash
Executable File
16 lines
430 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# 设置日志文件夹的路径
|
|
LOGGING_DIR="logging"
|
|
|
|
# 遍历logging文件夹中的所有文件
|
|
for file in "$LOGGING_DIR"/*; do
|
|
# 检查文件是否包含"ERROR"
|
|
if ! grep -q "Traceback" "$file"; then
|
|
# 如果不包含"ERROR",则删除文件
|
|
echo "Deleting $file as it does not contain Traceback "
|
|
rm "$file"
|
|
else
|
|
echo "$file contains ERROR, not deleting"
|
|
fi
|
|
done |