diff --git a/src/appstore.js b/src/appstore.js index fb4f80d76..862d982fa 100644 --- a/src/appstore.js +++ b/src/appstore.js @@ -164,7 +164,8 @@ function sendAliveStatus(data, callback) { provider: result[settings.TLS_CONFIG_KEY].provider }, backupConfig: { - provider: result[settings.BACKUP_CONFIG_KEY].provider + provider: result[settings.BACKUP_CONFIG_KEY].provider, + hardlinks: !result[settings.BACKUP_CONFIG_KEY].noHardlinks }, mailConfig: { enabled: result[settings.MAIL_CONFIG_KEY].enabled diff --git a/src/storage/filesystem.js b/src/storage/filesystem.js index 9ba9f75f0..bc47e9902 100644 --- a/src/storage/filesystem.js +++ b/src/storage/filesystem.js @@ -107,7 +107,8 @@ function copy(apiConfig, oldFilePath, newFilePath) { if (error) return events.emit('done', new BackupsError(BackupsError.EXTERNAL_ERROR, error.message)); // this will hardlink backups saving space - shell.exec('copy', '/bin/cp', [ '-al', oldFilePath, newFilePath ], { }, function (error) { + var cpOptions = apiConfig.noHardlinks ? '-a' : '-al'; + shell.exec('copy', '/bin/cp', [ cpOptions, oldFilePath, newFilePath ], { }, function (error) { if (error) return events.emit('done', new BackupsError(BackupsError.EXTERNAL_ERROR, error.message)); events.emit('done', null); @@ -159,6 +160,8 @@ function testConfig(apiConfig, callback) { if (!apiConfig.backupFolder) return callback(new BackupsError(BackupsError.BAD_FIELD, 'backupFolder is required')); + if ('noHardlinks' in apiConfig && typeof apiConfig.noHardlinks !== 'boolean') return callback(new BackupsError(BackupsError.BAD_FIELD, 'noHardlinks must be boolean')); + fs.stat(apiConfig.backupFolder, function (error, result) { if (error) { debug('testConfig: %s', apiConfig.backupFolder, error); diff --git a/webadmin/src/views/settings.html b/webadmin/src/views/settings.html index dd45a6ec4..04ba3531b 100644 --- a/webadmin/src/views/settings.html +++ b/webadmin/src/views/settings.html @@ -146,6 +146,14 @@
+