My VPS is full, is this normal?

Hi,
I installed Yunohost on a 1984 VPS. Then I installed Nextcloud and a few apps.
My disk seem full, is it normal ?

:/home$ df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  473M     0  473M   0% /dev
tmpfs          tmpfs      98M  540K   98M   1% /run
/dev/vda       xfs        25G   25G  945M  97% /
tmpfs          tmpfs     489M     0  489M   0% /dev/shm
tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
tmpfs          tmpfs      98M     0   98M   0% /run/user/1007

In addition, I see a ./yunohost.app/nextcloud/data/me/files_trashbin/ full of large files.
I could empty it with trash-cli, but I would like an automated cleaning.

How could I ensure they are managed ? I tried to modify config.php as sais in the doc : Configuration Parameters — Nextcloud latest Administration Manual latest documentation

but I cannot access thee nextcloud directory !

:/var/www$ cd /nextcloud
-bash: cd: /nextcloud: No such file or directory

:/var# cd /www
-bash: cd: /www: No such file or directory

Use sudo su before these commands.

Thank you for caring, I must be missign something :slight_smile:

:/var/www$ sudo su cd /nextcloud
su: user cd does not exist or the user entry does not contain all the required fields

As said on OP, I also tried as root, there, I cannot even access www !

Sorry, I was unclear. Start with a first command sudo su, then hit Enter to have root access. Then you can cd into the directory.

Indeed it did not work in the OP, because you put a slash before nextcloud. There is no nextcloud directory at the root of the partition.

Try cd /var/www/nextcloud, it will work.

Or

cd /var/www
cd nextcloud
#not cd /nextcloud

Arf, got it ! I don’t know why I included this / :crazy_face:

So this part is solved, thank you !

Is it logical that a fresh Yunohost + Nexcloud plus a few apps need 20+Go ? (I also have my phone’s backup, that is 3.2Go)

It really depends on what you put in those apps and the policy for Nextcloud’s internal backups.

Well, at this stage about nothing as it’s a fresh install.
The main question is : how much space does Yunohost need just for install and same for Nextcloud (thereafter, I’ll care about room for data).

YunoHost is around 8GB I think, and Nextcloud maybe half a GB. (I have no precise figures, sorry)

If you want to investigate what uses so much space, you can install ncdu. It will show your folders hierarchy ordered by size. You may identify the culprits then. Navigate with the arrows, Enter to delve into a directory and Backspace to return.

sudo su
apt install ncdu
ncdu /

Thank you, I forgot ncdu ! :slight_smile:

Here is the culprit :

--- /home/yunohost.app/nextcloud/data/myself -------------------------------------------------------------------------------------------------------------------------------------------------------------------------
   12.7 GiB [##########] /files_trashbin                                                                                                                                                                           
    2.4 GiB [#         ] /files
    1.0 GiB [          ] /files_versions
  191.7 MiB [          ] /uploads
e   0.0   B [          ] /cache

This is quite odd : this install is about 10 days old and I remotely did something on it.

Any clue of what I can do or do I have to go to Nextcloud forum ?

# cat /var/www/nextcloud/config/config.php
<?php
$CONFIG = array (
  'passwordsalt' => 'xxxyyy',
  'secret' => 'xxxxyyyyy',
  'trusted_domains' => 
  array (
    0 => 'localhost',
    1 => 'mydomain.io',
  ),
  'datadirectory' => '/home/yunohost.app/nextcloud/data',
  'dbtype' => 'mysql',
  'version' => '22.2.3.0',
  'overwrite.cli.url' => 'https://mydomain.io',
  'dbname' => 'nextcloud',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'mysql.utf8mb4' => true,
  'dbuser' => 'nextcloud',
  'dbpassword' => 'xxxyyyy',
  'installed' => true,
  'instanceid' => '1234',
  'ldapProviderFactory' => 'OCA\\User_LDAP\\LDAPProviderFactory',
  'updatechecker' => false,
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'trashbin_retention_obligation' => 'auto',
  'versions_retention_obligation' => 'auto',
  'integrity.check.disabled' => true,
  'filelocking.enabled' => true,
  'memcache.locking' => '\\OC\\Memcache\\Redis',
  'redis' => 
  array (
    'host' => 'localhost',
    'port' => '6379',
    'timeout' => '0.0',
    'password' => '',
  ),
  'hashing_default_password' => true,
  'localstorage.allowsymlinks' => true,
  'simpleSignUpLink.shown' => false,
  'logout_url' => 'https://mydomain.io/yunohost/sso/?action=logout',
  'mail_smtpmode' => 'smtp',
  'mail_smtpsecure' => 'tls',
  'mail_sendmailmode' => 'smtp',
  'mail_smtpauthtype' => 'LOGIN',
  'mail_from_address' => 'me',
  'mail_domain' => 'mydomain.io',
  'mail_smtphost' => 'mydomain.io',
  'mail_smtpauth' => 1,
  'mail_smtpport' => '587',
  'mail_smtpname' => 'me',
  'mail_smtppassword' => 'password1234',
);

It is indeed rather a matter of Nextcloud configuration. Before requesting help on their forum, have a look to the app’s documentation: Deleted Items (trash bin) — Nextcloud latest Administration Manual latest documentation

Well, that’ what I did. (See the config.php)

The documentation says that it keeps the files in the trashbin for 30 days before deleting them. So I’d suggest you either manually delete them or wait for 30 days.

1 Like

I didn’t wait for 30 days as I was totally stuck. The only thing I didn’t try was the rude rm

The issue comes from the fact that one has to modify /var/www/nextcloud/config/config.php and add

  'trashbin_retention_obligation' => 'auto',
  'versions_retention_obligation' => 'auto',

(could amend like ` => ‘auto, 5’ to keep for 5 days)

And create a cron !

After fresh Install, Yunohost + Nextcloud are less than 5Go

:~# df -Th
Filesystem     Type      Size  Used Avail Use% Mounted on
udev           devtmpfs  473M     0  473M   0% /dev
tmpfs          tmpfs      98M  528K   98M   1% /run
/dev/vda       xfs        25G  4.7G   21G  19% /
tmpfs          tmpfs     489M   16K  489M   1% /dev/shm
tmpfs          tmpfs     5.0M     0  5.0M   0% /run/lock
tmpfs          tmpfs      98M     0   98M   0% /run/user/1007

There should be nothing to do for this.

  'trashbin_retention_obligation' => 'auto',
  'versions_retention_obligation' => 'auto',

You don’t have to set these as these are the defaults configurations and set automatically.

Cron is also already configured (see /etc/cron.d/nextcloud).

The problem here seems to be you have 12GB of files in the trash. If you only have 25GB storage on your VPS, consider increasing it. Or manually delete the files from the trashbin.

Well, I also assumed it was, then I had a doubt, because, really nothing special happened on my install.
No reason to have 12Go of trash, no reason for it to grow continuously.

I then read this: Configuration Parameters — Nextcloud latest Administration Manual latest documentation

For the cron, I see a cron in the file you just mention I read this : Configuration Parameters — Nextcloud latest Administration Manual latest documentation

And crontab -u www-data -l returned nothing before I amended.

Which one is active ?

Like I said:

Cron is also already configured (see /etc/cron.d/nextcloud).

well, I got this:

root@mydomain:~# crontab -u www-data -l
# Edit this file to introduce tasks to be run by cron.
# 
# Each task to run has to be defined through a single line
# indicating with different fields when the task will be run
# and what command to run for the task
# 
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').
# 
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
# 
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
# 
# For example, you can run a backup of all your user accounts
# at 5 a.m every week with:
# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
# 
# For more information see the manual pages of crontab(5) and cron(8)
# 
# m h  dom mon dow   command
*/5  *  *  *  * php -f /var/www/nextcloud/cron.php
root@mydomain:~# crontab -u nextcloud -l
no crontab for nextcloud
root@mydomain:~# cat /etc/cron.d/nextcloud
*/15  *  *  *  * nextcloud /usr/bin/php7.4 --define apc.enable_cli=1 -f /var/www/nextcloud/cron.php
root@mydomain:~# 

So, I’m actually not sure what your problem is. Cron is configured, auto deletion is also configured.

You have some big files in your trash. Maybe check these?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.