Skip to content

Instantly share code, notes, and snippets.

View camsloanftc's full-sized avatar

Cam Sloan camsloanftc

  • Squamish, Canada
View GitHub Profile
@camsloanftc
camsloanftc / render-aws-backup.ts
Created March 24, 2021 12:36 — forked from sjones6/render-aws-backup.ts
backup pg database to aws
import { spawn, execSync } from 'child_process';
import through2 from 'through2';
import fs from 'fs';
import * as AWS from 'aws-sdk';
function spawnPgDump(pgDumpPath, args, env) {
if (!fs.existsSync(pgDumpPath)) {
throw new Error('pg_dump not found at ' + pgDumpPath);
}