phpMyAdmin Cron 删除临时文件
我的主机上有一个文件夹,我会定期上传一些内容到 - /public_html/uploads
- 我想通过 phpMyAdmin 设置一个 cronjob 来定期清空它。
我在 pMA 中当前的 cron 是
find /public_html/uploads -maxdepth 1 -ctime 1 -exec rm -f {} \;
http://img641.imageshack.us/img641/668/1274390599451.png
(暂时忽略它每分钟运行一次的事实,所以我可以测试它:))
我对这个命令实际上在做什么知之甚少,但它看起来“不是很多”。谁能帮我解决它吗? :) 谢谢。
I have a folder on my hosting which I periodically upload something to - /public_html/uploads
- and I'd like to set up a cronjob through phpMyAdmin to empty it out on a regular basis.
The current cron I have in pMA is
find /public_html/uploads -maxdepth 1 -ctime 1 -exec rm -f {} \;
http://img641.imageshack.us/img641/668/1274390599451.png
(Ignore the fact that it's running every minute for now, it's so I can test it :) )
I know very little about what this command is actually doing, but it looks like "not very much". Can anyone help me fix it? :) Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该命令正在目录中查找最近一天以某种方式修改的文件并将其删除。
如果您只想删除目录中的所有内容,您可以使用:
rm -f /public_html/uploads/*
作为 cron 作业命令
The command is looking for files in the directory that where somehow modified in the last day and deletes them.
If you just want to delete everything in the directory you could just use a:
rm -f /public_html/uploads/*
As the cron job command