Nginx 自动/tmp 清理? [英] Nginx automated /tmp cleanup?
问题描述
我已经在我的 vps 上安装了 Nginx
I've installed Nginx on my vps
我在 Nginx Admin 中发现了这条消息
i found this message inside Nginx Admin
To automated /tmp cleanup add bellow cron
0 */1 * * * /usr/sbin/tmpwatch -am 1 /tmp/nginx_client
via crontab -e command
我应该在哪里执行这一行?
where i should execute this line ?
0 */1 * * * /usr/sbin/tmpwatch -am 1 /tmp/nginx_client
我的 vps centos 5 32 cpanel
my vps centos 5 32 cpanel
推荐答案
转到 VPS 的控制台并执行以下操作:
Go to the console of your VPS and do the following:
$ crontab -e
然后,在 cron 文件中(使用 * * * * *
语法安排作业,您可以阅读有关 维基百科上)输入该行:
Then, in the cron file (which schedules jobs using the * * * * *
syntax that you can read more about on Wikipedia) enter that line:
0 */1 * * * /usr/sbin/tmpwatch -am 1 /tmp/nginx_client
这将每小时执行一次 tmpwatch
命令.
This will execute the command tmpwatch
every hour, on the hour.
tmpwatch
将删除 /tmp/nginx_client
目录中所有修改文件时间超过 1 小时的文件.
tmpwatch
will remove all files with a modified file time greater than 1 hour in the /tmp/nginx_client
directory.
这篇关于Nginx 自动/tmp 清理?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!