Trashbin_auto_expire not working

Hi @all,

I have Owncloud Server 10.7.0 running, although the problem itself already existed with older versions of the 10.x branch.
PHP Vesion is 7.4.3
MySQL 8.0.23

In my config.php I have trashbin configured like that:

‘trashbin_retention_obligation’ => ‘14, 14’,
‘trashbin_auto_expire’ => true,

occ system:cron is run every 4 hours via cron

15 */4 * * * sudo -u www-data php7.4 -f /path/to/docroot/occ system:cron

If I run the cronjob manually I don’t get no output (assuming that no output means no error)

Nonetheless I have files in my trashbin that are about 2 months old.
Expected behaviour is that OC deletes files in my trashbin that are old that 14 days.

Does anyone have a hint for me how I can fix this or can anyone confirm this as a bug?
Bye, Dirk

Hi Dirk,

I am sorry but I think the config parameter is not used anymore.

In the docs I could only find 2 parameters regarding trash bin:

https://doc.owncloud.com/server/10.7/admin_manual/configuration/server/config_sample_php_parameters.html#code-sample-57

'trashbin_retention_obligation' => 'auto',

and

'trashbin_purge_limit' => 50,

I am guessing that your config parameter was removed during an update and the functionality has be moved in the option for another config parameter.

Could you try to remove the “auto” config option and run occ system:cron manually again?

Ok,

I tried but it didn’t change anything either.

This is what my config looks like now:

‘trashbin_retention_obligation’ => ‘auto’,
‘trashbin_purge_limit’ => 50,
// ‘trashbin_retention_obligation’ => ‘14, 14’,
// ‘trashbin_auto_expire’ => true,

I guess nothing was deleted because there is too much space left on the device. (I’m referring to the docs about trashbin_purge_limit “This setting defines the percentage of free space occupied by deleted files that triggers auto purging of deleted files for this user”)

Is there no easy way left to delete files in thrashbin after X time ?
If I understand the docs right it should be

‘trashbin_retention_obligation’ => ‘14, 14’,
From the docs for trashbin_retention_obligation: " D1, D2 keep files and folders in the trash bin for at least D1 days and delete when exceeds D2 days"

hi @Warlock

Can you change to: ‘trashbin_retention_obligation’ => ‘13, 14’,
and then what happens if you run: /occ trashbin:expire ?

Are those files that are older than 14 days already in the oc_jobs table?

Why do you have the cron job running only 15 */4 * * * the recommended is 15 * * * * or even every 5 minutes

I would recommend adding something like this:

23 0 * * * /usr/bin/php -f /var/www/owncloud/occ trashbin:expire
1 Like

Hi cdamken,

I think your hint was right on spot.

So what I did I do…
I changed trashbin_retention_obligation as suggested, did an occ trashbin:expire and got this:

`root@host:/somedir/config# sudo -u www-data php7.4 -f /somedir/occ trashbin:expire
2 [->--------------------------]
In Local.php line 397:

/somedir/data/user/files_trashbin/files/user.d1633542805/.mozilla-thunderbird is a broken/dead symlink

trashbin:expire [<user_id>…]`

Shall I delete .mozilla-thunderbirdmanually ?

I could not find the files in oc_jobs table but I guess this is because occ trashbin:expire failed,

Cronjob has been changed to every 15 minutes.

1 Like

Just gave it a try and deleting the symlink helped!
Now all files that are older that 13/14 days are deleted as expected.

Thank you very much cdamken!

1 Like

Hi, Yes, the storage from ownCloud should have symlinks, there is a trick and you could use them, but I would not recommend because you could have additional problems as you now experiented :wink:

Great that now worked :wink: