# Trash bin automatically cleared for one user

**URL:** <https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916>\
**Category:** ℹ️ Support\
**Tags:** nc11\
**Created:** [September 13, 2017, 12:09pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916 "2017-09-13T12:09:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![falolaf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/falolaf/32/2151_2.png) [@falolaf](https://help.nextcloud.com/u/falolaf)\
**Post date:** [September 13, 2017, 12:09pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916/1 "2017-09-13T12:09:11Z")

</div>

Nextcloud version _(eg, 10.0.2)_: 11.0.4  
Operating system and version _(eg, Ubuntu 16.04)_: openSUSE leap42.2  
Apache or nginx version _(eg, Apache 2.4.25)_: Apache 2.4…(don’t really know version for the moment.)  
PHP version _(eg, 5.6)_: 5.6  
Is this the first time you’ve seen this error?:  
Yes

Can you reliably replicate it? (If so, please outline steps):  
Delete a file. Open trash bin and find the deleted file. Wait some time, open trash bin and find the trash bin is empty.

The issue you are facing:  
Trash bin is automatically cleared for one account. Other accounts are not affected.

The output of your Nextcloud log in **Admin \> Logging** :  
Nothing from when this happens.

The output of your config.php file in `/path/to/nextcloud` (make sure you remove any identifiable information!):  
Not possible to fetch at this point in time.

The output of your Apache/nginx/system log in `/var/log/ ____ `:  
Not possible to fetch at this point in time.

* * *

Remember, this information may be requested if it isn’t supplied; for fastest response please provide as much as you can ❤ Feel free to use a pastebin service, otherwise log files can be indented with 4 spaces on each line to present them in a friendlier way on the forum.

---

<div class="post-metadata">

**Author:** ![anon99252149](https://help.nextcloud.com/letter_avatar/anon99252149/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon99252149](https://help.nextcloud.com/u/anon99252149)\
**Post date:** [September 14, 2017, 5:27pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916/2 "2017-09-14T17:27:32Z")

</div>

> [@falolaf](#):
>
> Trash bin is automatically cleared for one account. Other accounts are not affected.

It’s difficult without more information about quota and used space (%) of the account as well as the setting `'trashbin_retention_obligation'` from the `config.php` file. 😉

> [@falolaf](#):
>
> Wait some time

How long?

---

<div class="post-metadata">

**Author:** ![falolaf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/falolaf/32/2151_2.png) [@falolaf](https://help.nextcloud.com/u/falolaf)\
**Post date:** [September 14, 2017, 6:24pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916/3 "2017-09-14T18:24:43Z")

</div>

Here is my config.php:  
\<?php $CONFIG = array (  
‘instanceid’ =\> ‘xyz’,  
‘passwordsalt’ =\> ‘xyz’,  
‘secret’ =\> ‘xyz6’,  
‘trusted\_domains’ =\>  
array (  
0 =\> ‘abc’,  
1 =\> ‘def’,  
2 =\> ‘ghi’,  
3 =\> ‘jkl’,  
),  
‘datadirectory’ =\> ‘abc’,  
‘overwrite.cli.url’ =\> ‘abc’,  
‘dbtype’ =\> ‘mysql’,  
‘version’ =\> ‘11.0.4.1’,  
‘dbname’ =\> ‘owncloud’,  
‘dbhost’ =\> ‘localhost’,  
‘dbtableprefix’ =\> ‘oc\_’,  
‘dbuser’ =\> ‘owncloud’,  
‘dbpassword’ =\> ‘xyz’,  
‘logtimezone’ =\> ‘UTC’,  
‘installed’ =\> true,  
‘loglevel’ =\> 2,  
‘maintenance’ =\> false,  
‘updatechecker’ =\> false,  
‘memcache.local’ =\> ‘\OC\Memcache\APCu’,  
‘theme’ =\> ‘’,  
‘mail\_from\_address’ =\> ‘abc’,  
‘mail\_smtpmode’ =\> ‘smtp’,  
‘mail\_domain’ =\> ‘[gmail.com](http://gmail.com)’,  
‘mail\_smtpsecure’ =\> ‘ssl’,  
‘mail\_smtphost’ =\> ‘[smtp.gmail.com](http://smtp.gmail.com)’,  
‘mail\_smtpauth’ =\> 1,  
‘mail\_smtpport’ =\> ‘465’,  
‘mail\_smtpname’ =\> ‘abc’,  
‘mail\_smtppassword’ =\> ‘xyz’,  
‘updater.release.channel’ =\> ‘stable’,  
);

A few weeks back I enable a cronjob to run cron.php every 15 and that one has something to do with the problem. I disable that job and then the trash bin is not cleared any longer. If I reenable that job then the trash bin is cleared, every 15 minutes it seems…

I use about 40% of the quota.

But why is only one account showing this problem? What can I have done to configure it like that?

---

<div class="post-metadata">

**Author:** ![falolaf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/falolaf/32/2151_2.png) [@falolaf](https://help.nextcloud.com/u/falolaf)\
**Post date:** [September 17, 2017, 5:27pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916/4 "2017-09-17T17:27:02Z")

</div>

Some more information I now have.

It seems that quota is in the focus here. The account with the the issue had a qouta of 40 GB and used 17 GB. But, there were also files and folders shared with this account which put the total amount of data to 42 GB.

If I set the quota to more than 42 GB, e.g. 50, the trash bin is not cleared automatically. Resetting the quota to 40 GB again and the trash bin is automatically cleared.

To me this feels like a bug in the cron process. I mean, if someone shares a lot of files with another user that users trash is automatically cleared. Not good if any files should be restored.

---

<div class="post-metadata">

**Author:** ![anon99252149](https://help.nextcloud.com/letter_avatar/anon99252149/32/5_5575768a8748004e209b776fc1b2916d.png) [@anon99252149](https://help.nextcloud.com/u/anon99252149)\
**Post date:** [September 17, 2017, 6:09pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916/5 "2017-09-17T18:09:40Z")

</div>

> [@falolaf](#):
>
> To me this feels like a bug in the cron process.

Cron uses the default config settings.  
Try to modify the handling of the trash bin. The default setting is:

`'trashbin_retention_obligation' => 'auto',`

Set it to `disabled` and check again.

[https://docs.nextcloud.com/server/12/admin\_manual/configuration\_server/config\_sample\_php\_parameters.html#deleted-items-trash-bin](https://docs.nextcloud.com/server/12/admin_manual/configuration_server/config_sample_php_parameters.html#deleted-items-trash-bin)

---

<div class="post-metadata">

**Author:** ![falolaf](https://help.nextcloud.com/user_avatar/help.nextcloud.com/falolaf/32/2151_2.png) [@falolaf](https://help.nextcloud.com/u/falolaf)\
**Post date:** [September 18, 2017, 5:17pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916/6 "2017-09-18T17:17:42Z")

</div>

I have set it to ‘disabled’ and set quota to 40 GB again.  
Total number of files and folders, including shares: 42 GB  
Trash bin has not been cleared.

I wouldn’t say that this is a solution though as it is set to ‘auto’ as default.

---

<div class="post-metadata">

**Author:** ![h3rb3rt](https://help.nextcloud.com/user_avatar/help.nextcloud.com/h3rb3rt/32/9824_2.png) [@h3rb3rt](https://help.nextcloud.com/u/h3rb3rt)\
**Post date:** [January 9, 2020, 1:12pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916/7 "2020-01-09T13:12:27Z")

</div>

jump onto this as well, seems not to work as expected

> [@Trashbin\_retention\_obligation](https://help.nextcloud.com/t/trashbin-retention-obligation/31119/3):
>
> I realized, that my trash bin never got deleted. Which makes sense based on the documentation, the default setting 'trashbin\_retention\_obligation' =\> 'auto' and my users who do not have any quota being configured. Now I changed the setting to 'trashbin\_retention\_obligation' =\> '30,180',in config.php and even after deleting files, adding new files and ensuring the the cron job is working correctly every 5 minutes, I still have files in my trash bin older then 180 days. Actually I have still file…

---

<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 2, 2024, 2:33pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916/8 "2024-12-02T14:33:08Z")

</div>



---

<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, 1:53pm UTC](https://help.nextcloud.com/t/trash-bin-automatically-cleared-for-one-user/20916/9 "2024-12-04T13:53:31Z")

</div>


