Bug 1901523 - Stage and store backup snapshots under backups/snapshots. r=backup-reviewers,kpatenio
Differential Revision: https://phabricator.services.mozilla.com/D213078
This commit is contained in:
@@ -597,6 +597,16 @@ export class BackupService extends EventTarget {
|
||||
return "backups";
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the folder within the PROFILE_FOLDER_NAME where the staging
|
||||
* folder / prior backups will be stored.
|
||||
*
|
||||
* @type {string}
|
||||
*/
|
||||
static get SNAPSHOTS_FOLDER_NAME() {
|
||||
return "snapshots";
|
||||
}
|
||||
|
||||
/**
|
||||
* The name of the backup manifest file.
|
||||
*
|
||||
@@ -830,13 +840,17 @@ export class BackupService extends EventTarget {
|
||||
// profile.
|
||||
let backupDirPath = PathUtils.join(
|
||||
profilePath,
|
||||
BackupService.PROFILE_FOLDER_NAME
|
||||
BackupService.PROFILE_FOLDER_NAME,
|
||||
BackupService.SNAPSHOTS_FOLDER_NAME
|
||||
);
|
||||
lazy.logConsole.debug("Creating backups folder");
|
||||
|
||||
// ignoreExisting: true is the default, but we're being explicit that it's
|
||||
// okay if this folder already exists.
|
||||
await IOUtils.makeDirectory(backupDirPath, { ignoreExisting: true });
|
||||
await IOUtils.makeDirectory(backupDirPath, {
|
||||
ignoreExisting: true,
|
||||
createAncestors: true,
|
||||
});
|
||||
|
||||
let stagingPath = await this.#prepareStagingFolder(backupDirPath);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user