Could not delete temporary file "..." during garbage collection

Submitted by Dot on Thu, 06/02/2016 - 20:17

Recent log messages里总是有类似Could not delete temporary file "..." during garbage collection的报错,观察发现,每次都是5个一组,3小时一次,原来是cron时报错。

Screenshot from 2016-06-02 10-02-06.png

打开file过滤status为temporary的文件,果然就是这5个。

Screenshot from 2016-06-02 10-02-45.png

搜索了下,对应的是数据库中的表file_managed,status的两个值0和1分别代表temporary和permanent。


dotcra_drupal> select fid,uid,filename,uri,status from file_managed where status=0;
+-----+------+-----------------------------------------+-----------------------------------------------------------+--------+
| fid | uid  | filename                                | uri                                                       | status |
+-----+------+-----------------------------------------+-----------------------------------------------------------+--------+
|  35 |    1 | SSL_01.gif                              | public://SSL_01.gif                                       |      0 |
|  36 |    1 | SSL_01.gif                              | public://images/SSL_01.gif                                |      0 |
|  38 |    1 | Screenshot from 2016-04-24 11-13-37.png | public://images/Screenshot from 2016-04-24 11-13-37.png   |      0 |
|  39 |    1 | Screenshot from 2016-04-24 11-13-37.png | public://images/Screenshot from 2016-04-24 11-13-37_0.png |      0 |
|  40 |    1 | Screenshot from 2016-04-24 11-12-17.png | public://images/Screenshot from 2016-04-24 11-12-17.png   |      0 |
+-----+------+-----------------------------------------+-----------------------------------------------------------+--------+
5 rows in set (0.00 sec)

那么,用如下命令删除就OK了。


dotcra_drupal> delete from file_managed where status=0;

之后再运行cron无报错,终于清静了。

Tags

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.