简体   繁体   English

/ tmp目录未在实时服务器上清除

[英]/tmp directory is not cleaned on live server

Laravel: 5.5 Horizon: 1.2.3 php: 7.2 ubuntu: 16.04, LAMP Laravel:5.5地平线:1.2.3 php:7.2 Ubuntu:16.04,LAMP

I don't know if this issue is related to redis server of horizon, but what I'm sure that this happens. 我不知道此问题是否与地平线的Redis服务器有关,但是我确定会发生这种情况。 When using database driver the /tmp starts to fill with tmp php files with pattern like this php34gs1 phpwrd42 after the queue is processed the /tmp is cleaned and reverted. 使用数据库驱动程序时,/ tmp在队列处理后/ tmp便开始填充tmp php文件,其格式类似于php34gs1 phpwrd42。

However when I use redis driver with horizon the /tmp directory is filled untill my my 60GB server is full and I only resolve this either by deleting them manual from cli or worse to reboot server. 但是,当我在水平范围内使用redis驱动程序时,/ tmp目录将被填满,直到我的60GB服务器已满,而我只能通过从cli中删除它们的手册来解决此问题,或者更糟糕的是重新启动服务器。

带Redis驱动程序

使用数据库驱动程序

永久保留在那里的tmp php文件

Till now I can't solve this or know why it happens, but there is a work around to install a cron job to clean /tmp directory. 到现在为止,我仍无法解决或无法解决问题,但是可以解决安装cron作业以清理/tmp目录的问题。

The cron job will delete any file that is older that one day and will run daily at midnight. cron作业将删除任何一天以上且每天在午夜运行的文件。

By running crontab -e and paste the following: 通过运行crontab -e并粘贴以下内容:

0 0 * * * sudo find /tmp -type f -atime +1 -delete

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM