linux服务器中的应用程序产生的log日志,可以设置sh脚本,定时清理,脚本中添加下面执行语句:
find /home/logs -name "*.log" -exec cp /dev/null {} \;
编辑定时任务:crontab -e
设置每周执行一次:
0 0 * * 0 /ihome/clear-logsh
linux服务器中的应用程序产生的log日志,可以设置sh脚本,定时清理,脚本中添加下面执行语句:
find /home/logs -name "*.log" -exec cp /dev/null {} \;
编辑定时任务:crontab -e
设置每周执行一次:
0 0 * * 0 /ihome/clear-logsh