Hi ! We have a retention app configured, but what we cannot find is logs for the files which were deleted by the retention policy. We can view files manually deleted by the users, we can view when the job for files retention has been started, but still there is a gap with viewing what exact files were deleted with the retention policy in the logs we gather.
I am sorry, but the answer is not relevant it is not about how to edit the config, but a question on what should be done or even whether it’s possible to gather logs to view in nextcloud.log what files were deleted by the retention app. As for now we do not see in the logs what files were deleted by the retention app, we can see only those which were deleted manually. Please let us know how to configure it.
Above in my topic I have inserted part of the congig file which is responsible for the log configuration. Here are also some additional details:
Nextcloud version - 27.1.3.2
OS RHEL 7
@cstsila from what is documented, deleted files are not logged.
deleted files would be visible in activities though.
personally I use bash incl. log to find and delete files and folders within a group directory older than 7 days on OS-level. This has caveats though and requires rescanning sudo nextcloud.occ files:scan --all
example bash for Nextcloud snap: don’t copy & paste
#!/bin/bash
LOG="/NCcleanup.log" ## logfile variable
TARGET="/media/data/__groupfolders/1" ## groupfolder target variable
### cleanup, files and folders!
sudo find $TARGET -mindepth 2 -mtime +7 > $LOG ; ## find and write to log
sudo find $TARGET -mindepth 2 -mtime +7 -delete ; ## delete files and folders older 7 days
### Nextcloud clean trash per user and group
sudo nextcloud.occ trashbin:cleanup --all-users ; ## cleanup trash for all users
sudo nextcloud.occ groupfolders:trashbin:cleanup -f ; ## cleanup groupfolders trash
### Nextcloud rescan all files
sudo nextcloud.occ files:scan --all ; ## rescan all files and folders
exit
@scubamuc yeah, but again, it’s about manual deletion of the files. What I was talking about is files deleted with the Retention app, so files which are deleted automatically. So to sum up I already can see logs for attempts to delete files manually. The only part I need info about is whetehr I can see in the activity logs what files were attempted to be deleted by the Nextcloud Retention app.
yeah @cstsila that’s clear… but since there’re no further suggestions here, i’m guessing my suggestion about “logging” deleted files with bash seems to be the only viable method for this.