我有一个在午夜运行的 cron 作业,用于删除文件夹中超过 7 天的所有 .txt 文件。我可以看到作业正在运行,但文件仍然存在于文件夹中。
我是 cron 的新手,所以我真的很感激有人指出我哪里出错了,或者如果不明显的话如何诊断。
这是我隐藏目录的代码:
0 0 * * * bin/find /var/www/example.com/wp-content/targetdir -name "*.txt" -type f -mtime +7 -exec rm -rf {} \;
Run Code Online (Sandbox Code Playgroud)
提前谢谢大家。
hei*_*iko 15
这个工作正常:
0 0 * * * /usr/bin/find /var/www/example.com/wp-content/targetdir -name "*.txt" -type f -mtime +7 -exec rm -f {} \;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
31995 次 |
| 最近记录: |