How to clean up nextcloud-data/appdata_* and /updater-*

Hi there!
I am using an nc client since some time. Recently it stopped working and i think it is because the storage is simply full.
Here is the content of my nextcloud-data folder:

du -h -d 1
6,1M    ./buero
1,6G    ./werner
4,0K    ./__groupfolders
611M    ./andrea
2,5M    ./benji
11G     ./basti
60M     ./flo
238M    ./chris
6,1M    ./max
7,2M    ./charlie
16M     ./test
16M     ./paul
213M    ./david
12G     ./appdata_*
5,4M    ./nadia
204K    ./files_external
18G     ./benjamin
5,5G    ./updater-*
4,0K    ./nina
49G     .

As you might see appdata_* folder and updater-* folder are swallowing hugh space.
So my question is: How can I safely clean up those folders?

Unfortunately I am running the NC-instance on an shared hoster so my permissions are very limited. FTP and SSH work but only some basic commands and no sudo stuff. I know that this is unlucky but anyway…

1 Like

updater-* contains backups of your system before update, will be automatically cleaned but still contains a lot of backups that you could rollback to.
If you updated successfully, you can simply delete folders under it.

appdata-* this depends on apps that you are using, e.g. previews will take a lot of space, or recognize app.

1 Like

Thanks! I thought that updater-* won’t be the Problem.
But with regard to appdata-* … I can’t find a prober way how to clean it up … Thing is that it is already pretty consuming.
Would it be a solution to simple setup NC anew and try to put all the databases and userdata into it? I guess that some occ commands would be required, what makes my case difficult…by the way what would be the correct commands?

Just check what kind of app is consuming so much and optimize (e.g. for Preview App) or remove it. For me previews are most biggest folder, but it is already much smaller than before.

du -h -d 1 /var/nextcloud/data/appdata_xxxxxxxxxxxx/
64K     /var/nextcloud/data/appdata_xxxxxxxxxxxx/external
177M    /var/nextcloud/data/appdata_xxxxxxxxxxxx/ocr
31M     /var/nextcloud/data/appdata_xxxxxxxxxxxx/facerecognition
24K     /var/nextcloud/data/appdata_xxxxxxxxxxxx/cms_pico
204K    /var/nextcloud/data/appdata_xxxxxxxxxxxx/theming
148K    /var/nextcloud/data/appdata_xxxxxxxxxxxx/identityproof
15G     /var/nextcloud/data/appdata_xxxxxxxxxxxx/preview
8.0K    /var/nextcloud/data/appdata_xxxxxxxxxxxx/dashboard
1.3M    /var/nextcloud/data/appdata_xxxxxxxxxxxx/dav-photocache
1004K   /var/nextcloud/data/appdata_xxxxxxxxxxxx/avatar
620K    /var/nextcloud/data/appdata_xxxxxxxxxxxx/js
3.5M    /var/nextcloud/data/appdata_xxxxxxxxxxxx/appstore
8.0K    /var/nextcloud/data/appdata_xxxxxxxxxxxx/richdocuments
12K     /var/nextcloud/data/appdata_xxxxxxxxxxxx/text
1.2M    /var/nextcloud/data/appdata_xxxxxxxxxxxx/css
15G     /var/nextcloud/data/appdata_xxxxxxxxxxxx/

Your users uses +30 GB and the preview is 15 GB.
If you want you can configure preview read here .

Personally I think the thumbnails are basically too big.

1 Like

Okay. Same here. Preview is using over 13GB. Any suggestions for “reasonable” values in config.php?
Will adjusting the previewer section in the config.php remove the “old” or not used previews?

1 Like

As I linked above you can adjust config, my current config is:

Read more about:
https://ownyourbits.com/2019/06/29/understanding-and-improving-nextcloud-previews/

And than you need to regenerate previews again:

Short summery from the Github:

To “reset” the preview cache

  1. Stop Webserver (apache / nginx)
  2. Moved the appdata_instaceName/preview folder outside the appdata folder. You can just remove it if you are confident.
  3. Run sudo -u www-data /usr/bin/php /var/www/nextcloud/occ files:scan-app-data to fix database
  4. Start Webserver and Test everything works
  5. Finish up (delete moved folder, etc).
  6. Run pregenerate command afterwards.
2 Likes

Okay! Perfect! Thanks for the explanation. Helps alot :slight_smile:

This helped me, but the link (“read more about”) seems to have turned into something… unwanted and should be removed or updated. Here is a link to a snapshot of the source form the time of the post: https://web.archive.org/web/20210907035157/https://ownyourbits.com/2019/06/29/understanding-and-improving-nextcloud-previews/

The domain ownyourbits. com seems to be forwarded to some fishy abovenetwork. co.in domain.

2 Likes