You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Allow to set the trash bin size to a percentage value of the available disk space and to reset it to the default value #22549
Please use the 👍 reaction to show that you are also in favor of this feature - we are using this information to decide which features to include in upcoming Nextcloud versions.
Please don't comment if you have no relevant information to add
Expected behavior
The new occ command (trashbin:size) should allow to set the size of the trash bin to a percentage value of the available disk space and also allow to reset the value to the default of 50%.
Current behavior
The new occ command (trashbin:size) has been introduced to configure the size of the trash bin. This currently only seems to allow to set the size to a fixed size and doesn't allow to set a percentage value of the available disk space, nor does it allow to reset the value to the default of 50% of the available disk space.
I haven't found a way to reset the parameter to the default value: > ./occ trashbin:size -1 => The "-1" option does not exist
I haven't found a way to configure a percentage value of the available disk space: > ./occ trashbin:size 10% => Failed to parse input size
Steps to reproduce
Open a command line session
Execute the given command and see what happens
Environment
Server Configuration
OS: Linux 4.9.218
Web server: Apache2 2.4.46
Database: MariaDB 10.2.24
PHP version: 7.4.8
Nextcloud version: 19.0.2
Client Configuration
Browser: Mozilla Firefox 80.0.1
Operating system: Windows 10
if (preg_match('#([kmgtp]?b?)$#si', $str, $matches) && !empty($bytes_array[$matches[1]])) {
$bytes *= $bytes_array[$matches[1]];
} else {
returnfalse;
}
$bytes = round($bytes);
return$bytes;
}
The input is parsed by the above method. Only absolute numbers are supported. Pull requests are always welcome but keep in mind that datadirectory might be on a different hard disk or object storage is used. To find right disk size is the difficult part here.
@kesselb Thank you for the explanation. I wouldn't have ever thought about using the config:app:delete or user:setting commands to reset a value for which an explicit trashbin:size command has been introduced. I think many other users will run into this trap too.
In this case it would have been more intuitive to use the config:app:set or user:sitting:... way to set the parameters. If you think it isn't bug then it might be at least an enhancement request to get the syntax aligned with other other commands.
Yes, please.
Allow me to set the default-quota to 100% of the users' quotas, so when they delete everything in an almost full account by accident, they dont lose any files and can restore everything.
Activity
j-ed commentedon Sep 2, 2020
@kesselb I've seen that you seem to work on related issues #22475 and #22528. It might be worse to fix these points too.
kesselb commentedon Sep 2, 2020
🤣
System:
occ config:app:delete files_trashbin trashbin_sizeUser:
occ user:setting --delete $UID files_trashbin trashbin_sizeserver/lib/private/legacy/OC_Helper.php
Lines 90 to 130 in c077c15
The input is parsed by the above method. Only absolute numbers are supported. Pull requests are always welcome but keep in mind that datadirectory might be on a different hard disk or object storage is used. To find right disk size is the difficult part here.
j-ed commentedon Sep 2, 2020
@kesselb Thank you for the explanation. I wouldn't have ever thought about using the
config:app:deleteoruser:settingcommands to reset a value for which an explicittrashbin:sizecommand has been introduced. I think many other users will run into this trap too.In this case it would have been more intuitive to use the
config:app:setoruser:sitting:...way to set the parameters. If you think it isn't bug then it might be at least an enhancement request to get the syntax aligned with other other commands.szaimen commentedon Jun 9, 2021
I suppose this issue is still valid?
j-ed commentedon Jun 10, 2021
Yes, I'm not aware about any changes.
szaimen commentedon Jan 23, 2023
Hi, this sounds more like a feature reqhest to me.
someone-somenet-org commentedon Dec 15, 2025
Yes, please.
Allow me to set the default-quota to 100% of the users' quotas, so when they delete everything in an almost full account by accident, they dont lose any files and can restore everything.