ansible test3

This commit is contained in:
zhangzhihan
2020-03-10 19:52:21 +08:00
parent 93c88826d3
commit 03867d8afb
33 changed files with 1219 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
#!/bin/sh
#只保留最近三天的日志如需要多保留几天修改8行最后 -n days
#将此脚本加载到系统定时任务中 /etc/crontab
#脚本会读取环境变量,固需要配置环境变量。
#. /etc/profile
day=$(date +"%Y-%m-%d" -d "-3 days")
kafka=`jps | grep Kafka | wc -l`
if [[ $kafka = "1" ]];then
rm -rf $KAFKA_HOME/logs/*.$day*
fi