backups: add remotePath
the main motivation is that id can be used in REST API routes. previously, the id was a path and this had a "/" in it. This made /api/v1/backups/:backupId not work.
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
if (process.argv[2] === '--check') return console.log('OK');
|
||||
if (process.argv[2] === '--check') {
|
||||
console.log('OK');
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const assert = require('assert'),
|
||||
async = require('async'),
|
||||
@@ -22,11 +25,11 @@ function initialize(callback) {
|
||||
}
|
||||
|
||||
// Main process starts here
|
||||
const backupId = process.argv[2];
|
||||
const remotePath = process.argv[2];
|
||||
const format = process.argv[3];
|
||||
const dataLayoutString = process.argv[4];
|
||||
|
||||
debug(`Backing up ${dataLayoutString} to ${backupId}`);
|
||||
debug(`Backing up ${dataLayoutString} to ${remotePath}`);
|
||||
|
||||
process.on('SIGTERM', function () {
|
||||
process.exit(0);
|
||||
@@ -73,7 +76,7 @@ initialize(function (error) {
|
||||
dumpMemoryInfo();
|
||||
const timerId = setInterval(dumpMemoryInfo, 30000);
|
||||
|
||||
backuptask.upload(backupId, format, dataLayoutString, throttledProgressCallback(5000), function resultHandler(error) {
|
||||
backuptask.upload(remotePath, format, dataLayoutString, throttledProgressCallback(5000), function resultHandler(error) {
|
||||
debug('upload completed. error: ', error);
|
||||
|
||||
process.send({ result: error ? error.message : '' });
|
||||
|
||||
Reference in New Issue
Block a user