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:
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?
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.
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