brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: occ trashbin:size caps how big the Nextcloud trash bin may grow

Nextcloud
~/tips/tip-nextcloud-trashbin-size

sudo -E -u www-data php occ trashbin:size

Shows or sets how large the Nextcloud trash bin may be, globally or per user.

Nextcloud keeps deleted files in a trash bin, and on a small data disk that bin can quietly take a lot of room. I run Nextcloud on my Unraid server, so I care where that space goes. There is an occ command that sets a size target for it.

Without arguments the command shows the current target:

sudo -E -u www-data php occ trashbin:size
  Default size: default (50% of available space)

In the official Docker image you run occ as the web user, like this: docker exec -it --user www-data nextcloud php occ trashbin:size, with your own container name. To set a global target, or one for a single user, add a size:

occ trashbin:size 10GB
occ trashbin:size --user layla 2GB
occ trashbin:size --user layla

The last line shows the effective size for that user. Sizes can be written in human-readable form such as 10GB.

Read this before you try it: changing the global default immediately triggers a cleanup of the existing trash bins. Older items go out of the trash, so pick a number you are comfortable with, and think about what people may still want to restore. The docs also say a user’s trash can temporarily exceed the target until that user next moves a file to the trash.

One more caveat. I read this in the latest admin manual, and the command may not exist in an older Nextcloud. Run occ list first and look for trashbin:size. If it is not there, trashbin:expire and the trashbin_retention_obligation setting in config.php are the way to go; the manual says that command only does something when a custom retention period is set.

Further reading: occ files commands, trash bin (Nextcloud admin manual), Using the occ command (Nextcloud admin manual), Nextcloud Docker image: using occ

Going deeper: Guide: link Prowlarr to Sonarr and Radarr once, and stop typing indexers into every app

More Nextcloud tips sudo -E -u www-data php occ user:report sudo -E -u www-data php occ app:update --showonly sudo -E -u www-data php occ background-job:history -s 3 -l 10 docker exec --user www-data nextcloud php occ maintenance:mode --on docker exec -it --user www-data nextcloud php occ user:resetpassword layla All Nextcloud tips (13) All topics

Link