File are deleted 2 days after the expiration date
Hi,
files seem to be deleted 2 days past their expiration time. Imo there is nothing special in my config except that I enforce burn after reading.
Config
{
hypnotoad => {
listen => ['http://127.0.0.1:8081'],
proxy => 1,
workers => 30,
clients => 1,
},
contact => '<a href="xxx"</a>',
report => 'help@example.com,
secrets => ['12345'],
instance_name => 'Service',
max_file_size => 15728640,
broadcast_message => 'Contact info',
default_delay => 3,
allow_pwd_on_files => 0,
force_burn_after_reading => 1,
mail => {
how => 'smtp',
howargs => ['localhost']
},
mail_sender => 'service@exmple.com',
dbtype => 'mysql',
mysqldb => {
database => 'lufi',
host => 'localhost',
user => 'lufi',
pwd => 'pass',
},
keep_ip_during => 30,
};
Query
select short,deleted,delete_at_day,created_at, FROM_UNIXTIME(created_at) as created_at_h, FROM_UNIXTIME(last_access_at) as last_access, FROM_UNIXTIME(created_at + (delete_at_day * 84600)) as expires_at from files where filename is not null and deleted = 0 order by created_at;
Results
+------------+---------+---------------+------------+---------------------+-------------+---------------------+
| short | deleted | delete_at_day | created_at | created_at_h | last_access | expires_at |
+------------+---------+---------------+------------+---------------------+-------------+---------------------+
| ZtAXauLvTa | 0 | 1 | 1600247874 | 2020-09-16 11:17:54 | NULL | 2020-09-17 10:47:54 |
| Ae58zLVVWP | 0 | 3 | 1600255337 | 2020-09-16 13:22:17 | NULL | 2020-09-19 11:52:17 |
| x4NsdHrvYw | 0 | 3 | 1600256596 | 2020-09-16 13:43:16 | NULL | 2020-09-19 12:13:16 |
| J7r94Ft8Ln | 0 | 3 | 1600256697 | 2020-09-16 13:44:57 | NULL | 2020-09-19 12:14:57 |
| 5rF2PpaHD8 | 0 | 3 | 1600256793 | 2020-09-16 13:46:33 | NULL | 2020-09-19 12:16:33 |
| AAQ7EFnWY6 | 0 | 3 | 1600256835 | 2020-09-16 13:47:15 | NULL | 2020-09-19 12:17:15 |
| pNkWtyoB5o | 0 | 3 | 1600256902 | 2020-09-16 13:48:22 | NULL | 2020-09-19 12:18:22 |
| jfyfzQF1P0 | 0 | 3 | 1600256929 | 2020-09-16 13:48:49 | NULL | 2020-09-19 12:18:49 |
| PLwoBDQ_u7 | 0 | 3 | 1600256995 | 2020-09-16 13:49:55 | NULL | 2020-09-19 12:19:55 |
| YVSVEsJEZ8 | 0 | 3 | 1600270119 | 2020-09-16 17:28:39 | NULL | 2020-09-19 15:58:39 |
| Q_6UZRVNtc | 0 | 3 | 1600270853 | 2020-09-16 17:40:53 | NULL | 2020-09-19 16:10:53 |
| 2XuPMoj0EH | 0 | 3 | 1600270902 | 2020-09-16 17:41:42 | NULL | 2020-09-19 16:11:42 |
| tN8L5YkpSg | 0 | 3 | 1600271570 | 2020-09-16 17:52:50 | NULL | 2020-09-19 16:22:50 |
| YrF7juJnNK | 0 | 3 | 1600273827 | 2020-09-16 18:30:27 | NULL | 2020-09-19 17:00:27 |
| rXfy_UqUXo | 0 | 3 | 1600274529 | 2020-09-16 18:42:09 | NULL | 2020-09-19 17:12:09 |
| LRE7wpgGFp | 0 | 3 | 1600274614 | 2020-09-16 18:43:34 | NULL | 2020-09-19 17:13:34 |
| pLNHVxdu3K | 0 | 3 | 1600274676 | 2020-09-16 18:44:36 | NULL | 2020-09-19 17:14:36 |
| jFgh__jLkv | 0 | 3 | 1600276361 | 2020-09-16 19:12:41 | NULL | 2020-09-19 17:42:41 |
| 9P9QP_b7PD | 0 | 3 | 1600276377 | 2020-09-16 19:12:57 | NULL | 2020-09-19 17:42:57 |
| tfYRWzctf2 | 0 | 3 | 1600276447 | 2020-09-16 19:14:07 | NULL | 2020-09-19 17:44:07 |
| 4oZgpA3eR5 | 0 | 3 | 1600277127 | 2020-09-16 19:25:27 | NULL | 2020-09-19 17:55:27 |
+------------+---------+---------------+------------+---------------------+-------------+---------------------+
So for example ZtAXauLvTa
should already have been deleted today but it is still present in the filesystem. Through previous observation I expect that it will be deleted at 2020-09-19 10:47:54
.
me@host: /opt/lufi$ ls -lht files/ZtAXauLvTa/
total 3.9M
-rw-r--r-- 1 www-data www-data 38K Sep 16 11:17 3.part
-rw-r--r-- 1 www-data www-data 1.3M Sep 16 11:17 2.part
-rw-r--r-- 1 www-data www-data 1.3M Sep 16 11:17 1.part
-rw-r--r-- 1 www-data www-data 1.3M Sep 16 11:17 0.part
The crontab runs hourly.
# m h dom mon dow command
@hourly cd /opt/lufi && /usr/local/bin/carton exec script/lufi cron cleanfiles --mode production
Do you have any idea what could be going on ?