第一步编写.sh脚本 在这里我写的是清理两天前的文件,起名为log_clear.sh 第二步:给log_clear.sh文件赋权 chmod +x log_clear.sh 打开crontab crontab -e 第三步: 让log_clear.sh文件每天中午12:00执行一次(将下面命令写入crontab中) 00 12 * * * sh /home/LOG_CLC/log_clear.sh (前面五个参数分别代表:min hour day month year) 第四步:保存退出(别忘了验证哦)