Changing location of /tmp/seahub_cache


I would like to change the caching directory from
‘/tmp/seahub_cache’ to ‘$HOME/logs/seahub_cache’.

The caching location is defined inside the program area
CACHE_DIR = “/tmp”

I tried to overwrite this location by overwrite the variable
inside $HOME/conf/
CACHE_DIR = “/data/seafile/haiwen/logs”

but it does not work. It’s still in /tmp

Maybe somebody can give me a small hint how to change the location
of the seahub caching directory?

Best regards

try add the following setting to (below the sentence of CACHE_DIR = "/data/seafile/haiwen/logs")

import os
    'default': {
        'BACKEND': 'django.core.cache.backends.filebased.FileBasedCache',
        'LOCATION': os.path.join(CACHE_DIR, 'seahub_cache'),
        'OPTIONS': {
            'MAX_ENTRIES': 1000000

Hallo Lian,

cool, after adding

 CACHE_DIR = os.environ.get('SEAHUB_LOG_DIR', '/tmp')

before the definition “CACHES = { …”, the cache location
changed now to …/haiwen/logs/seahub_cache

Great. Thanks very much!



Could I ask how the actual final file looked like in the end.

I think I have the same problem to solve (to move the default location of /tmp) but I can’t get it to work.

Would be very much appreciated :wink:

Cheers, Chris


same problem.
PermissionError: [Errno 13] Permission denied: '/tmp/seahub_cache/ceec40422771f78d283f254429d1d993.djcac

HOw i can set permisison or move tmp folder?

First of all, I doubt that this is the same problem. You reopened a post from mid-2017. Sooo many things have changed since then!

Soluction to my problem: I set 777 permisison to temp folder on root and solved