Tmp/ folder is filling up - can it be deleted

Nextcloud version: 24.0.4
Operating system and version: Debian bullseye
Apache : 2.4.54-1~deb11u1
PHP version: 7.4

The issue you are facing:

Overtime the tmp folder fills up. Some directories/ files are month old.
As a temporary workaround it would be nice to know if those can be deleted

Steps to replicate it:

Unfortunately we dont know what is causing this.

The output of your Nextcloud log in Admin > Logging:
Nothing

I would like to know two.

-rw------- 1 www-data www-data 3945156 jun 14 16:25 nextcloud_photos_2pY1H4
-rw------- 1 www-data www-data 3945156 jun 14 16:40 nextcloud_photos_3u5NvN
-rw------- 1 www-data www-data 3945156 jun 19 19:40 nextcloud_photos_4aemme
-rw------- 1 www-data www-data 3945156 jun 21 13:25 nextcloud_photos_4gnwbD
-rw------- 1 www-data www-data 3945156 jul 5 18:00 nextcloud_photos_4QBy1v
-rw------- 1 www-data www-data 3945156 jun 14 21:10 nextcloud_photos_5RPmO7
-rw------- 1 www-data www-data 3945156 jun 21 21:00 nextcloud_photos_5Xwws4
-rw------- 1 www-data www-data 3945156 jun 19 11:00 nextcloud_photos_6RwzV2
-rw------- 1 www-data www-data 3945156 jul 5 18:15 nextcloud_photos_7i3sq3
-rw------- 1 www-data www-data 3945156 jun 18 09:45 nextcloud_photos_7pveql
-rw------- 1 www-data www-data 3945156 jun 26 10:00 nextcloud_photos_7sgJY0
-rw------- 1 www-data www-data 3945156 jun 14 16:55 nextcloud_photos_9SoLag
-rw------- 1 www-data www-data 3945156 jun 23 18:35 nextcloud_photos_aFduSt
-rw------- 1 www-data www-data 3945156 jun 18 14:00 nextcloud_photos_ANsGj1
-rw------- 1 www-data www-data 3945156 jun 19 19:50 nextcloud_photos_cfyyLE
-rw------- 1 www-data www-data 3945156 jun 18 22:10 nextcloud_photos_CmimUk
-rw------- 1 www-data www-data 3945156 jun 30 03:38 nextcloud_photos_D4rCgg
-rw------- 1 www-data www-data 3945156 jun 24 15:47 nextcloud_photos_DAsGYj
-rw------- 1 www-data www-data 3945156 jun 27 16:20 nextcloud_photos_EBTbWx
-rw------- 1 www-data www-data 3945156 jun 17 16:15 nextcloud_photos_ekfPWL
-rw------- 1 www-data www-data 3945156 jun 26 00:50 nextcloud_photos_EMb7Bn
-rw------- 1 www-data www-data 3945156 jun 20 17:46 nextcloud_photos_eX1ADu
-rw------- 1 www-data www-data 3945156 jun 22 10:10 nextcloud_photos_FRw3Ft
-rw------- 1 www-data www-data 3945156 jun 21 15:05 nextcloud_photos_Fwtu9x
-rw------- 1 www-data www-data 3945156 jun 17 19:20 nextcloud_photos_GpY7gb
-rw------- 1 www-data www-data 3945156 jun 26 13:20 nextcloud_photos_Gr3lqz
-rw------- 1 www-data www-data 3945156 jun 22 15:30 nextcloud_photos_HHAr03
-rw------- 1 www-data www-data 3945156 jul 5 16:05 nextcloud_photos_HLXmcq
-rw------- 1 www-data www-data 3945156 jun 26 09:31 nextcloud_photos_hZcF8F
-rw------- 1 www-data www-data 3945156 jul 5 17:05 nextcloud_photos_IC61EB
-rw------- 1 www-data www-data 3945156 jun 22 09:50 nextcloud_photos_IlXofN
-rw------- 1 www-data www-data 3945156 jul 4 10:50 nextcloud_photos_j8Otwk
-rw------- 1 www-data www-data 3945156 jun 18 20:15 nextcloud_photos_JgP4cj
-rw------- 1 www-data www-data 3945156 jun 14 16:45 nextcloud_photos_JS65w8
-rw------- 1 www-data www-data 3945156 jun 20 16:55 nextcloud_photos_Kd2et5
-rw------- 1 www-data www-data 3945156 jun 18 10:10 nextcloud_photos_KWgsqr
-rw------- 1 www-data www-data 3945156 jun 13 13:20 nextcloud_photos_L2KjvO
-rw------- 1 www-data www-data 3945156 jun 22 10:00 nextcloud_photos_l2Ohow
-rw------- 1 www-data www-data 3945156 jun 22 10:30 nextcloud_photos_M2O3hT
-rw------- 1 www-data www-data 3945156 jun 17 16:10 nextcloud_photos_mj4deq
-rw------- 1 www-data www-data 3945156 jun 23 18:20 nextcloud_photos_NdWXOl
-rw------- 1 www-data www-data 3945156 jun 24 11:36 nextcloud_photos_Nr1u7r

when will my instance handle these files. are they save to delete.

I use auto upload on android and remove from device on several users. I can (not) check if there photo’s are all uploaded correctly.

Your instance handles these temporary files in the /tmp directory during the process of building and using the KDTree for the ReverseGeoCoderService in the Nextcloud Photos app. Specifically, these files are created when the KDTree is built or loaded, and the data from these temporary files is then copied to a permanent file named cities1000.bin located in the data/appdata_$instanceid/photos/geonames/ directory.

  • Creation: The temporary files are created whenever the KDTree is built or accessed.
  • Usage: They are used to temporarily store KDTree data before it is written to the permanent cities1000.bin file.
  • Lifecycle: After the KDTree data is copied to cities1000.bin, the temporary files are no longer actively used by the application.
  • Since the KDTree data is already copied to the permanent file (cities1000.bin), the temporary files in the /tmp directory are redundant.
  • It is safe to delete these temporary files as they are no longer needed once the cities1000.bin file has been updated.

It is unusual for the cities1000.zip to be repeatedly downloaded and processed. The code is designed to check if the cities1000.bin file already exists before initiating a new download:

This check ensures that the download and processing occur only if the cities1000.bin file is missing or if a forced update is triggered.

“forced” is only triggered if you invoke the occ command:

occ photos:update-1000-cities

Note that the /tmp directory is typically mounted as a tmpfs, meaning its contents are cleared on system restart. If this is not the case on your system, consider configuring it to ensure /tmp is mounted as tmpfs. This configuration helps maintain the transient nature of temporary files and may resolve issues related to file persistence or repeated downloads.

→ Here ← I have explained the steps how you can move your /tmp directory to tmpfs.


Much and good luck,
ernolf

I am not sure what KDTree is or does. I can use the photo app but for apps/photo/ and apps/photo/photo/ loading thumbs takes over 30 min all the other folders,faces,thisday are instant.

I have applied the tmpfs to /tmp with 8Gb of size but the files are still not flushed. this will result in a full /tmp at some point as I do not regularly restart and files are still piling up.

I have run the command

occ photos:update-1000-cities

without knowing what it does but it exited with exit code 0 and tmpfiles remained.

I leave this for now as I have other thoughts to do with my cloud.