From 205d59c893f058489b07b0117639cf85865efd7e Mon Sep 17 00:00:00 2001 From: TrepnickKev <57950508+TrepnickKev@users.noreply.github.com> Date: Fri, 23 Jan 2026 16:28:00 +0100 Subject: [PATCH] fix(backups): move Kopia cache and config to Umbrel data directory --- .../umbreld/source/modules/backups/backups.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/packages/umbreld/source/modules/backups/backups.ts b/packages/umbreld/source/modules/backups/backups.ts index 2631c2171..e54cfd7ce 100644 --- a/packages/umbreld/source/modules/backups/backups.ts +++ b/packages/umbreld/source/modules/backups/backups.ts @@ -74,6 +74,11 @@ export default class Backups { this.running = true this.startedAt = Date.now() + // Ensure kopia directories exist on the SSD + await fse.mkdir(`${this.#umbreld.dataDirectory}/kopia/cache`, {recursive: true}) + await fse.mkdir(`${this.#umbreld.dataDirectory}/kopia/config`, {recursive: true}) + await fse.mkdir(`${this.#umbreld.dataDirectory}/kopia/logs`, {recursive: true}) + // Cleanup any left over backup mounts await this.unmountAll().catch((error) => this.logger.error('Error unmounting backups', error)) @@ -183,9 +188,14 @@ export default class Backups { const spawnKopiaProcess = async () => { // Spawn process const env = { - KOPIA_CHECK_FOR_UPDATES: 'false', - XDG_CACHE_HOME: '/kopia/cache', - XDG_CONFIG_HOME: '/kopia/config', + ...process.env, + KOPIA_CHECK_FOR_UPDATES: 'false', + XDG_CACHE_HOME: '/kopia/cache', + XDG_CONFIG_HOME: '/kopia/config', + XDG_CACHE_HOME: `${this.#umbreld.dataDirectory}/kopia/cache`, + XDG_CONFIG_HOME: `${this.#umbreld.dataDirectory}/kopia/config`, + KOPIA_CACHE_DIRECTORY: `${this.#umbreld.dataDirectory}/kopia/cache`, + KOPIA_LOG_DIR: `${this.#umbreld.dataDirectory}/kopia/logs`, } const process = execa('kopia', flags, {env})