Automatic Files & Folders deletion


We started using NC15 with the idea of using the “File Retention” feature. It works fine for all our users but, we’ve realized that only files are deleted, folders don’t.

We have NC configured with our Active Directory/LDAP, so users can access easily and we can manage their access.

Is there any way to delete folders also? What we need to do is to delete the entire user data after X period of time (1 month for example).

If not possible, is there any way to delete or “reset” the user’s profile with all data?

Of course that running any kind of script to delete all user’s files and folders from their nextcloud data directory is not a solution, and doesn’t work fine this way.

Maybe you can give us any way to achieve this.

Many thanks in advance,

Nextcloud version:
Operating system: Ubuntu 18.04.2 LTS
Mysql version: 10.1.38
Apache version: 2.4.29
PHP version: 7.2.15

Dear Albert,
did you have a look to the app
“Automated Tagging” and “Retention”

it should be work but I didn´t tryed.

Hello Alexander,

Yes, it’s how we have it configured right now. We tag all files greater than 0 MB (all files) and then apply a File Retention of X days. And it works perfect, but it keeps all the folders structure (empty).


It might be worse to open a feature request to get this function added to the app.]

Thanks j-ed, if there’s no way to do this maybe I should suggest it. Thx!