Files
txspector-new/delete_logs.sh
T
2024-06-15 11:27:29 +08:00

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