mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-31 12:33:40 +00:00
Feature/backup+restore (#2613)
* feat: Implementation on the backup for the service. * wip: Getting the flow of backup/restore * feat: Recover * Feature: Commit the full pass on the backup restore. * use special type for backup instead of special id (#2614) * fix: Allow compat docker style to run again * fix: Backup for the js side * chore: Update some of the callbacks --------- Co-authored-by: Aiden McClelland <3732071+dr-bonez@users.noreply.github.com>
This commit is contained in:
@@ -1,14 +1,17 @@
|
||||
import * as fs from "node:fs/promises"
|
||||
|
||||
export const BACKUP = "backup"
|
||||
export class Volume {
|
||||
readonly path: string
|
||||
constructor(
|
||||
readonly volumeId: string,
|
||||
_path = "",
|
||||
) {
|
||||
const path = (this.path = `/media/startos/volumes/${volumeId}${
|
||||
!_path ? "" : `/${_path}`
|
||||
}`)
|
||||
if (volumeId.toLowerCase() === BACKUP) {
|
||||
this.path = `/media/startos/backup${!_path ? "" : `/${_path}`}`
|
||||
} else {
|
||||
this.path = `/media/startos/volumes/${volumeId}${!_path ? "" : `/${_path}`}`
|
||||
}
|
||||
}
|
||||
async exists() {
|
||||
return fs.stat(this.path).then(
|
||||
|
||||
Reference in New Issue
Block a user