定时删除edas多余日志

来源:互联网 发布:淘宝ifashion质量好么 编辑:程序博客网 时间:2024/06/06 02:49

由于项目初期服务器购买40G, 现在每天的日志量较大, 需定期清理

创建清除日志脚本

# mkdir /data# touch /data/deledaslog.sh

编写清除日志脚本

#!/bin/bashrm -rf /home/admin/edas-agent/sbin/logs/*

编写定时任务脚本

# crontab -e
*/1 * * * * sh /home/admin/edas-agent/bin/monitor.sh# delete tomcat log daily0 0 * * * sh /data/deledaslog.sh

查看磁盘信息

# df -h# du -shc *
原创粉丝点击