Skip to content
Snippets Groups Projects
Unverified Commit 63d199a8 authored by izzy's avatar izzy
Browse files

feat: spit out mongodump logs

parent 61d83ccb
No related branches found
No related tags found
No related merge requests found
......@@ -76,18 +76,25 @@ export class SSHExecutor extends Executor {
const fn = `/tmp/mongodump_${new Date().toISOString()}`;
try {
await this.ssh.exec("mongodump", [
"-o",
fn,
plan.strategy.connectionUrl,
]);
await this.ssh.exec(
"mongodump",
["-o", fn, plan.strategy.connectionUrl],
{
onStdout(chunk) {
console.log("stdout", chunk.toString("utf8"));
},
onStderr(chunk) {
console.log("stderr", chunk.toString("utf8"));
},
}
);
} catch (err: any) {
if (("" + err).toString().includes("Failed")) {
throw err;
}
}
await this.ssh.exec("tar", ["czvfP", pkgFn, fn]);
await this.ssh.exec("tar", ["cvfP", pkgFn, fn]);
await this.ssh.exec("rm", ["-r", fn]);
break;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment