Trash bin retention doesn't have effect

Hello.

I’m using Nextcloud 12.0.3.

I’ve been testing the config parameter “trashbin_retention_obligation” but it’s not working like expected.

In my config.php I set as following (for testing purposes):

'trashbin_retention_obligation' => 1, 3,

But, deleted files older than 3 days are not permanentely deleted.

Nextcloud seems just to respect the thrash bin quota set on Trashbin.php (DEFAULTMAXSIZE = 50; i.e 50% of my remaining account quota)

In my tests I change the date of my Linux server via date -s to simulate the time passing.

When the trash bin quota is exceeded, Nextcloud do the cleaning and delete permanentely the older files inside trash until the quota is in your acceptable limit, ignoring the retention time.

On the other hand, even when the retention time is expired, if quota is whitin your limit, nothing happens. So, retention has no effect.

Furthermore, thrash bin has stranger behaviors.

For example, if you have execeed your thrash bin quota (e.g. deleting files and upload new ones filling the account again), the cleaning won’t run until the next day, and only after you upload or delete some file.

PS: I’ve set my cron job to run every minute for quick tests purposes.

Somene else noticed these same behaviors?

Cheers

I’ve set mine to 'trashbin_retention_obligation' => 'auto, 30', and it does appear to have had an effect - a year’s worth of deleted items disappeared.

After new tests and reading the documentation I could understand that the cleaning of expired items occurs only when you delete some file after expiration.

Nextcloud checks the age of deleted files every time new files are added to the deleted files.

Also, I’ve noticed that it keeps the files based on the first parameter of ‘trashbin_retention_obligation’ even if the trashbin quota was exceeded (if parameter is NOT auto).

So, based on previous example 'trashbin_retention_obligation' => 1, 3,

1 - It will keep the files for one day.
2 - After that, if the thrashbin quota is exceeded, it will clean delete files until the quota is in your limit. But, this cleaning will happen when you add new files, according the documentation.

Additionally, Nextcloud calculates the maximum available space every time a new file is added. If the deleted files exceed the new maximum allowed space Nextcloud will expire old deleted files until the limit is met once again

3 - After three days, when a file is deleted, all expired files are cleaned.

Documentation:
https://docs.nextcloud.com/server/12/user_manual/files/deleted_file_management.html
https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#deleted-items-trash-bin
https://docs.nextcloud.com/server/12/user_manual/files/quota.html

1 Like