Retention App logs - how to view what files were deleted

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.

Configuration in the .php file as follow:
‘log_type’ => ‘syslog’,
‘syslog_tag’ => ‘Nextcloud’,
‘logfile’ => ‘’,
‘loglevel’ => 0,
‘log.condition’ =>
array (
‘apps’ =>
array (
0 => ‘admin_audit’,
),
),
);

Please let us know how we can reconfigure it or what should be done to gather logs for the files deleted by the retention app.

Thank you!

Hey @cstsila welcome to the community :raised_hands:

you haven’t completed Support template. Please use this when you request support so we’re just guessing here…

if you’re not using the snap, the description should be similar…

official documents are here Deleted Items (trash bin) — Nextcloud latest Administration Manual latest documentation

Hello :blush:

I am sorry, but the answer is not relevant :cold_sweat: 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

1 Like

Hello @scubamuc !
please let me know if there are any updates or maybe you know there is a documentation on this.

Thank you! :orange_heart:

1 Like

@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
1 Like

@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.

Thank you!

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.

you could try to ask the app devs directly on GitHub · Where software is built maybe they can give you a hint…

@scubamuc so simply files which were automatically deleted by the systems won’t be visible in the logs, am I correct?

Thanks a lot for your help! :blush:

1 Like