diff --git a/packages/hydrooj/src/commands/db.ts b/packages/hydrooj/src/commands/db.ts index 233ce1f10..bc82eac74 100644 --- a/packages/hydrooj/src/commands/db.ts +++ b/packages/hydrooj/src/commands/db.ts @@ -16,7 +16,7 @@ const exec = (...args: Parameters) => { if (res.status) throw new Error(`Error: Exited with code ${res.status}`); return res; }; -const dir = `${os.tmpdir()}/${Math.random().toString(36).substring(2)}`; +const dir = process.env.HYDRO_BACKUP_DIR || `${os.tmpdir()}/${Math.random().toString(36).substring(2)}`; function getUrl() { const dbConfig = fs.readFileSync(path.resolve(hydroPath, 'config.json'), 'utf-8'); const opts = JSON.parse(dbConfig);