查看文章 |
定期删除smarty缓存目录过期文件
2009-08-11 12:03
smarty的缓存目录的文件需要定期删除,否则该目录的文件数目将会越来越多,进而影响到文件读取的速度。可以新建一个定期任务,而任务的命令也非常简单(假设smarty的缓存目录是/opt/www/tmp/cache): find /opt/www/tmp/cache -name '*.tpl' -atime +3|xargs /bin/rm -f find /opt/www/tmp/cache -name '*.tpl' -atime +3 表示找出/opt/www/tmp/cache目录中以tpl为后缀、最后访问时间在3天之前的文件。然后利用管道命令,将这些文件作为参数,传给命令 /bin/rm -f强制性地删除掉。 |
最近读者: