Linux crontab -e 删除7天前创建的文件
# 每周六删除目录 /ctl 7天前创建的文件
0 0 * * 6 sudo find /ctl -type f -mtime +6 -exec rm -f {} \;
这篇博客介绍了如何在Linux环境中设置cron定时任务,结合find命令自动删除7天前位于/ctl目录下的文件。这个自动化过程有助于定期清理无用文件,保持系统整洁。
Linux crontab -e 删除7天前创建的文件
# 每周六删除目录 /ctl 7天前创建的文件
0 0 * * 6 sudo find /ctl -type f -mtime +6 -exec rm -f {} \;
763
629
2433
1029
312
683

被折叠的 条评论
为什么被折叠?