SOLVED: File Retention app not working as expected

Hi,

I´m trying to get the file retention app working. Goal is, to automatically delete all the files in a specific folder, which are old than a specific time.

For this, I created two collaborative tags, “parent-auto-delete-two-weeks” (public) and “auto-delete-two-weeks” (invisible).
Then I configured new flow:


I also created a file retention policy:

When I set the “parent-auto-delete-two-weeks” to a folder “temp-autodelete-folder” in my nextcloud share, all the files in the folder get automatically the “auto-delete-two-weeks” tag, as expected.
The files also get deleted after two weeks, as expected.

But my problem is, that the “temp-autodelete-folder” also gets deleted after 2 weeks.
How can I avoid this and keep the rest of the automatism active?

Check examples in the documentation Automated tagging of files — Nextcloud latest Administration Manual latest documentation

It is written a bit about this case:

In this case folder will be also tagged with tag Protected file, to avoid this, simply modify the rule to exclude Directory httpd/unix-directory from it.

2 Likes

thx for the quick reply, I will give this a try!

1 Like

Thanks for this solution, worked for me!

But what would I have to do, if I wanted folders within the “temp-autodelete-folder” to get the “auto-delete-two-weeks” tag? Is there any way to include these or to exclude only the parent folder?

You can try workaround - remove the folder rule (MIME) and add exception rule that name should not be equal to the folder name.
This will cause situation when user creates folder with the same name within your upload folder it also will not be deleted.

temp-autodelete-folder     #This is your upload folder
  - file1                  #This will be deleted
  - Folder2                #This will be deleted
  - temp-autodelete-folder #This will NOT be deleted
1 Like

Thanks a lot, that works! Although the rule says filename, it sets the tags for folders as well!