How to delete all files files in trash older than

Nextcloud version (eg, 20.0.5):
Operating system and version (eg, Ubuntu 20.04): Debian 10.9
PHP version (eg, 7.4): php 7.3

The issue you are facing:
How can I delete all files files in trash older than eks 3 weeks?

I tride to put in config.php

‘trashbin_retention_obligation’ => ‘auto, 30’,

But thing are not being deleted.

I have over 28 000 files from over a year ago

Have you read the adminstrator guide and especially the part about how to control the file deletion using a background job? This might help you to achive the result you’re expecting if the default mechanism doesn’t work as expected.

1 Like


Yes, I tride to run
Activate background job: occ config:app:delete files_trashbin background_job_expire_trash

Expire versions: occ trashbin:expire

If I understood ritgth the the files older than 30 days would then be deleted.

I have not put the commands in a Cron job. Should I do that?

The disk for next cloud is filling up
/dev/sdc1 689G 620G 34G 95% /srv

Most of the files are in a group folder. But in Nextcloud it’s onlye 190 GB I have used. So the rest is deleted files an versions of old files.

I ran the commands for controlling file version and aging to.
Activate background job: occ config:app:delete files_versions background_job_expire_versions

Expire versions: occ versions:expire