diff --git a/src/planner.ts b/src/planner.ts index cd9d6605968bc250dea302a4f90cef71925eac39..fb7eb559f429d8e0bcb7406d490f9ed3447d02b9 100644 --- a/src/planner.ts +++ b/src/planner.ts @@ -19,9 +19,12 @@ type Destination = { host: string; /** + * For ssh-agent: * Path to folder or leading path for the file - * * e.g. /backups/ or /path/to/backup_ + * + * For rsync-agent: + * Corresponding destination path on machine */ path: string; }; @@ -47,6 +50,13 @@ export type Blueprint = { strategy: BackupStrategy; destinations: Destination[]; } + | { + mode: "rsync-agent"; + host: string; + hooks?: Hooks; + path: string; + destinations: Destination[]; + } | { mode: "dummy"; } @@ -167,7 +177,13 @@ export function createPlan( id: blueprint._id, mode: "skipped", }; - } else { + } else if (blueprint.mode === "rsync-agent") { + return { + id: blueprint._id, + mode: "skipped", + }; + } + { const host = hosts[blueprint.host]; if (!host) throw `Host ${colors.gray(blueprint.host)} does not exist!`; if (!host.available) throw "Host is unavailable!";