Group Folders: How to empty trash / versions


I´ve found different threads for my topic, but haven´t found any documentation: how can I delete the trash and version of group folders?

1 Like

There are several known issues concerning trash and group folders like:

And many more:

This still seems to be a big construction site at the moment.

I have the problem, that a trashbin from one group folder is physically deleted (trashbin has been deleted manually on server file system level, I know, it was dumb)
occ groupfolders:scan does not scan the trashbin. I understand that scanning the trashbin for NEW files would be impossible, since they need the meta data from where they came from etc. but is there a way, to get those entries out of my mariadb database?
A scan mechanism that recognises the absence of files registered in trash, would that not be a good idea?
Who knows the mysql commands to do this job by hand or does there exist a how to somewhere out there?

Thanks a lot in advance for any answer :revolving_hearts:

edit 1:
I was able to almost completely reconstruct the physical trashbin with the logfiles, adding some empty files with the same name but two items are stil there. Unable to remove them out of my deleted files window. They where from earlier not complete uploaded and then deleted files. A clue how to remove those entries?

edit 2:
:white_check_mark: Solution
The zombie-entries disapear after a “Restore”. Only an error message in logfile “unable to rename, file does not exists … (path/to/trashbin/filename)” appears but it restores the file-entry in the webview. After it is restored, it is easy to remove that entry (without underlying file in the filesystem) by simply deleting it again or do an occ groupfolders:scan

we opened a bounty on this missing function.
Please spread the voice and contribute as you can:

Another major release und no workaround so far. :triumph:

As usual, if a product is getting more financial oriented, the essential basics are being ignored more often. It seems to be more important to build some fancy-schmancy dashboards and collab solutions.
What if a sysadmin does not monitor the free space on his nextcloud? What if this trash folder fills the hard drive and the Nextcloud get inaccessible?
Remember the basics! It’s more important than you may think.


Check latest release from today.

Hello @Ky-Pe ,

welcome to the community of Nextcloud.

Who defines the basics? You? me? Are group folders basics?

Then the sysadmin is failing with his basics :slight_smile:

1 Like

Hey rakekniven

Thank you for the welcome.

Touché :wink:

You can check the implementation progress here:


OK, so progress is going into trashbin consistency, that’s perfect, thanks to all!

I’m concerned about versions, though. That is because just deleting files would lead to inconsistency/broken links for users while there is not even an occ command to purge versions for groupfolders, right? Would a groupfolder:scan (after deleting files) repair broken links?


I’m answering to this thread because it’s the closest I could find regarding my problem.

After quite a lot of research and because I had a similar problem (a user included his Em-Client mail files in the syncing, because this email client seems to be a everything-in-one-file type of client, each received email generate a new version, the nextcloud instance filled from 50gb to 280gb in a 3 days …) I used this solution:

  • first of course the user removed the email client mail files from the synchronization
  • I then ran the following command to force expiration of all the versions without an existing file:

sudo -u user php /home/user/public_html/occ groupfolders:expire

(of course replace “user” with your vhost username, I mean the one running your nextcloud instance).

I guess this might be the command you were looking for purging group folders from older versions or at least versions not anymore linked to a synced file. As far as I am concerned this brought back my instance to 43gb which is about the right amount of files my users do really share.


1 Like