refactor(mikrotikBackupRoutes, mikrotikBackupScheduler): update backup export command to use /rest/execute with compact terse script for improved reliability
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 2m19s

This commit is contained in:
2026-02-09 20:51:43 +07:00
parent 89d35cd7ef
commit 7f2c4c3c8f
2 changed files with 4 additions and 5 deletions
+2 -2
View File
@@ -261,8 +261,8 @@ async function runBackupNow(req, res) {
throw e; throw e;
} }
// /rest/export с compact, как в планировщике // /rest/execute с командой "/export compact terse", как в планировщике
const resp = await client.command('export', { compact: '' }); const resp = await client.command('execute', { script: '/export compact terse' });
const data = resp && resp.data; const data = resp && resp.data;
let config = ''; let config = '';
if (typeof data === 'string') config = data; if (typeof data === 'string') config = data;
+2 -3
View File
@@ -53,9 +53,8 @@ async function getServerIdsFromUiSettings(logger) {
} }
async function fetchRouterExport(client) { async function fetchRouterExport(client) {
// Согласно официальной документации, /rest/export позволяет экспортировать конфиг. // Используем /rest/execute с командой "/export compact terse", чтобы гарантированно получить вывод в ответе.
// Параметр "compact" без значения эквивалентен /export compact. const res = await client.command('execute', { script: '/export compact terse' });
const res = await client.command('export', { compact: '' });
const data = res && res.data; const data = res && res.data;
if (!data) return ''; if (!data) return '';