Linuxタイミングタスクの追加
896 ワード
# vim del-logs.sh
# 6:30
# 7 : find /root/mnt/iot/logs/spring.log.* -mtime +7
# :crontab -e : crontab -l
# chmod +x del-logs.sh
# 6:30 crontab -e
# 30 6 * * * /root/mnt/iot/del-logs.sh
find /root/mnt/iot/logs/spring.log.* -mtime +35 -exec rm -rf {} \;
転載先:https://www.cnblogs.com/iathanasy/p/9473027.html