How do DISABLE: trashbin delete permanently / empty trash bin folder

I have a request but I am not able to put it into practice.
How to disable the “remove permanently” option in the “deleted files” folder? :slightly_frowning_face:

The purpose is to prevent a user from permanently removing files from the cloud. The user can remove files in their folders, but in the “deleted files” folder, prohibit or only allow them to be removed permanently after 60 days.

Already tried *‘trashbin_retention_obligation’ *

Available values:


    default setting. keeps files and folders in the trash bin for 30 days and automatically deletes anytime after that if space is needed (note: files may not be deleted if space is not needed).

D, auto

    keeps files and folders in the trash bin for D+ days, delete anytime if space needed (note: files may not be deleted if space is not needed)

auto, D

    delete all files in the trash bin that are older than D days automatically, delete other files anytime if space needed

D1, D2

    keep files and folders in the trash bin for at least D1 days and delete when exceeds D2 days (note: files will not be deleted automatically if space is needed)


    trash bin auto clean disabled, files and folders will be kept forever

Can anyone help me how to configure it?
Is there any other solution?

Best Regards

Nextcloud version (eg, 26.0.3): 26.0.3

As far as I know, there is no way to prohibit cloud users from emptying their trashbin.

You could make backups or a second “trashbin” in which each deleted file is additionally also stored. That should be out of the file-structure of the user, so that he can empty his trashbin and in case of unwanted deletion, you have the backup.
But the Information about original location etc. would then be lost unless you save those informations as well.

Much luck

1 Like

Thanks Eernolf
I was looking into this using Tags, but was not been successful doing it yet.


You can do that with Flow external script, invoked whenever a file is deleted and the user is member of a certain group, then you can pass that to an external script that creates the backup.

You have to write it yourself but it is an easy task.



I was looking a way to do as you say but I was not successful. I dont know how to tag a delete/moved to trash file ou folder.
Can you help me on direction?


But I thought you wanted to backup those files, why tagging them?

You can do that with File actions, therefore you must write an actions script in lua code in the File actions section or you must install “Workflow external scripts - workflow_script”:


and pass the task to an external script which you have to write yourself as well.

I didn’t do it myself, because I can’t see the point for me why I should create a backup of files to be deleted when I already create my daily- weekly- and monthly backups from all files.

It could also be quite possible that it is not feasible at all, as I have thought of above. Therefor you should try it out yourself.

If it doesn’t work that way, you could do it outside of Nextcloud and monitor the trash bin folder with inotifywait that then would trigger your backup task per script/service.

Hope this helps,
much luck!

1 Like