From a1ae08da58c047d27e07725219532212638dda1e Mon Sep 17 00:00:00 2001 From: TengDream <42526114+tenoms@users.noreply.github.com> Date: Wed, 6 May 2026 00:32:29 +0800 Subject: [PATCH] fix: create root .tmp directory on init for data export (#2993) The data export feature (system backup) writes data.tgz to `config.tmpPath` which resolves to `/.tmp/`. However, `initFile.ts` only created `/log/.tmp/` (used for crontab list temp files), never the root-level `.tmp/` directory. In Docker deployments, `shell/share.sh`'s `fix_config()` creates `$dir_root/.tmp` during shell initialization, but local/non-Docker deployments that start the Node service directly skip the shell init, causing a 404 ENOENT error when attempting to export/backup data. Add `rootTmpPath` (`/.tmp/`) to the directories array in `initFile.ts` so it is created during Node service startup regardless of deployment method. --- back/loaders/initFile.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/back/loaders/initFile.ts b/back/loaders/initFile.ts index 2eab9446..ac629d63 100644 --- a/back/loaders/initFile.ts +++ b/back/loaders/initFile.ts @@ -20,6 +20,7 @@ const uploadPath = path.join(dataPath, 'upload/'); const bakPath = path.join(dataPath, 'bak/'); const samplePath = path.join(rootPath, 'sample/'); const tmpPath = path.join(logPath, '.tmp/'); +const rootTmpPath = path.join(rootPath, '.tmp/'); const confFile = path.join(configPath, 'config.sh'); const sampleConfigFile = path.join(samplePath, 'config.sample.sh'); const sampleTaskShellFile = path.join(samplePath, 'task.sample.sh'); @@ -44,6 +45,7 @@ const directories = [ preloadPath, logPath, tmpPath, + rootTmpPath, uploadPath, sshPath, bakPath,