使用 crontab -e 添加如下命令:
* * */5 * * find /home/wwwlogs -name '*.log' -exec rm -rf {}\;
* * */5 * * find /home/wwwlogs -name '*_log' -exec rm -rf {}\;
重新加载任务:
systemctl reload crond
每隔5天清理一次日志
使用 crontab -e 添加如下命令:
* * */5 * * find /home/wwwlogs -name '*.log' -exec rm -rf {}\;
* * */5 * * find /home/wwwlogs -name '*_log' -exec rm -rf {}\;
重新加载任务:
systemctl reload crond
每隔5天清理一次日志