Linux 添加定时任务

# 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