backup: Add externalDisk option to fs backend

This merely confirms from the user understands that backups have to
stored on an external disk.
This commit is contained in:
Girish Ramakrishnan
2018-06-07 11:13:57 -07:00
parent 8c5b550caa
commit 7fd1bb8597

View File

@@ -162,6 +162,8 @@ function testConfig(apiConfig, callback) {
if ('noHardlinks' in apiConfig && typeof apiConfig.noHardlinks !== 'boolean') return callback(new BackupsError(BackupsError.BAD_FIELD, 'noHardlinks must be boolean'));
if ('externalDisk' in apiConfig && typeof apiConfig.externalDisk !== 'boolean') return callback(new BackupsError(BackupsError.BAD_FIELD, 'externalDisk must be boolean'));
fs.stat(apiConfig.backupFolder, function (error, result) {
if (error) return callback(new BackupsError(BackupsError.BAD_FIELD, 'Directory does not exist or cannot be accessed: ' + error.message));
if (!result.isDirectory()) return callback(new BackupsError(BackupsError.BAD_FIELD, 'Backup location is not a directory'));