开发者

phpMyAdmin Cron to Delete Temporary Files

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.


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜