# Group Folders: How to empty trash / versions

**URL:** <https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174>\
**Category:** ℹ️ Support\
**Tags:** teamfolders-app\
**Created:** [August 30, 2019, 6:30pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174 "2019-08-30T18:30:21Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![yoursql719](https://help.nextcloud.com/user_avatar/help.nextcloud.com/yoursql719/32/650_2.png) [@yoursql719](https://help.nextcloud.com/u/yoursql719)\
**Post date:** [August 30, 2019, 6:30pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/1 "2019-08-30T18:30:21Z")

</div>

Hi,

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?

---

<div class="post-metadata">

**Author:** ![Shen](https://help.nextcloud.com/letter_avatar/shen/32/6_22734026db12803ebb3e059622ac3534.png) [@Shen](https://help.nextcloud.com/u/Shen)\
**Post date:** [October 18, 2019, 9:12pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/2 "2019-10-18T21:12:00Z")

</div>

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

> <https://github.com/nextcloud/groupfolders/issues/314>
>
> I'm running NC 15.0.4 with the group folder plugin 2.0.2. At the moment i have the strange behavior.
> I delete some files...

  

> <https://github.com/nextcloud/groupfolders/issues/464>
>
> When deleting files from a group folder they are assigned to a trash bin, even though the AddOn "Deleted Files" is...

  
And many more:  

> **[nextcloud/groupfolders](https://github.com/nextcloud/groupfolders/issues?utf8=%E2%9C%93&q=is%3Aissue%2Bis%3Aopen%2Btrashbin)**
>
> 📁👩‍👩‍👧‍👦 Admin-configured folders shared by everyone in a group. - nextcloud/groupfolders

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

---

<div class="post-metadata">

**Author:** ![ernolf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/ernolf/32/77874_2.png) [@ernolf](https://help.nextcloud.com/u/ernolf)\
**Post date:** [December 22, 2019, 4:49pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/3 "2019-12-22T16:49:38Z")

</div>

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 💞

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:  
✅ 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`

---

<div class="post-metadata">

**Author:** ![freiheitswolke.org](https://help.nextcloud.com/letter_avatar/freiheitswolke.org/32/6_22734026db12803ebb3e059622ac3534.png) [@freiheitswolke.org](https://help.nextcloud.com/u/freiheitswolke.org)\
**Post date:** [June 9, 2020, 1:13pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/4 "2020-06-09T13:13:07Z")

</div>

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

> **[$100 Bounty on nextcloud/groupfolders](https://www.bountysource.com/issues/69919948-tashbin-cannot-be-cleared-with-group-folder-data)**
>
> nextcloud/groupfolders

---

<div class="post-metadata">

**Author:** ![yoursql719](https://help.nextcloud.com/user_avatar/help.nextcloud.com/yoursql719/32/650_2.png) [@yoursql719](https://help.nextcloud.com/u/yoursql719)\
**Post date:** [October 3, 2020, 9:03am UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/5 "2020-10-03T09:03:12Z")

</div>

Another major release und no workaround so far. 😤

---

<div class="post-metadata">

**Author:** ![Ky-Pe](https://help.nextcloud.com/letter_avatar/ky-pe/32/6_22734026db12803ebb3e059622ac3534.png) [@Ky-Pe](https://help.nextcloud.com/u/Ky-Pe)\
**Post date:** [October 5, 2020, 7:07am UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/6 "2020-10-05T07:07:47Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![rakekniven](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rakekniven/32/67096_2.png) [@rakekniven](https://help.nextcloud.com/u/rakekniven)\
**Post date:** [October 7, 2020, 4:30pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/8 "2020-10-07T16:30:46Z")

</div>

Check latest release from today.

---

<div class="post-metadata">

**Author:** ![rakekniven](https://help.nextcloud.com/user_avatar/help.nextcloud.com/rakekniven/32/67096_2.png) [@rakekniven](https://help.nextcloud.com/u/rakekniven)\
**Post date:** [October 7, 2020, 4:32pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/9 "2020-10-07T16:32:47Z")

</div>

Hello @Ky-Pe ,

welcome to the community of Nextcloud.

> [@Ky-Pe](#):
>
> the essential basics

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

> [@Ky-Pe](#):
>
> What if a sysadmin does not monitor the free space on his nextcloud?

Then the sysadmin is failing with his basics 🙂

---

<div class="post-metadata">

**Author:** ![Ky-Pe](https://help.nextcloud.com/letter_avatar/ky-pe/32/6_22734026db12803ebb3e059622ac3534.png) [@Ky-Pe](https://help.nextcloud.com/u/Ky-Pe)\
**Post date:** [October 30, 2020, 10:10am UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/10 "2020-10-30T10:10:06Z")

</div>

Hey rakekniven

Thank you for the welcome.

> [@rakekniven](#):
>
> Then the sysadmin is failing with his basics 🙂

Touché 😉

---

<div class="post-metadata">

**Author:** ![Jonas](https://help.nextcloud.com/user_avatar/help.nextcloud.com/jonas/32/77742_2.png) [@Jonas](https://help.nextcloud.com/u/Jonas)\
**Post date:** [November 17, 2020, 5:53pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/11 "2020-11-17T17:53:20Z")

</div>

You can check the implementation progress here:

> <https://github.com/nextcloud/groupfolders/pull/991#issuecomment-729093708>

---

<div class="post-metadata">

**Author:** ![nursoda](https://help.nextcloud.com/user_avatar/help.nextcloud.com/nursoda/32/1044_2.png) [@nursoda](https://help.nextcloud.com/u/nursoda)\
**Post date:** [January 12, 2021, 6:48am UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/12 "2021-01-12T06:48:05Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Pierr0t](https://help.nextcloud.com/letter_avatar/pierr0t/32/6_22734026db12803ebb3e059622ac3534.png) [@Pierr0t](https://help.nextcloud.com/u/Pierr0t)\
**Post date:** [January 20, 2022, 6:07pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/13 "2022-01-20T18:07:23Z")

</div>

Hello,

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.

Pierre.

---

<div class="post-metadata">

**Author:** ![punkyard](https://help.nextcloud.com/user_avatar/help.nextcloud.com/punkyard/32/59179_2.png) [@punkyard](https://help.nextcloud.com/u/punkyard)\
**Post date:** [February 21, 2024, 5:28pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/14 "2024-02-21T17:28:44Z")

</div>

this worked for me:

empty all bins of all users:  
`sudo -u www-data php /var/www/html/occ trashbin:cleanup --all-users`

empty groupfloder bins:  
`sudo -u www-data php /var/www/html/occ groupfolders:trashbin:cleanup`

or go to the the folder of your NC installation and occ file (doesn’t work if you can’t access Command Line Interface) and run the commands

---

<div class="post-metadata">

**Author:** ![wwe](https://help.nextcloud.com/user_avatar/help.nextcloud.com/wwe/32/72963_2.png) [@wwe](https://help.nextcloud.com/u/wwe)\
**Post date:** [December 4, 2024, 12:13pm UTC](https://help.nextcloud.com/t/group-folders-how-to-empty-trash-versions/59174/15 "2024-12-04T12:13:21Z")

</div>


