mongodb-gdrive-backup

1.0.1 • Public • Published

mongodb-gdrive-backup

const BackupService = require("mongodb-gdrive-backup");

let service = new BackupService({
  uri: "mongodb://localhost/db",
  drive: {
    auth: {
      /* google service account configuration here*/
    },
    folder: "shared folder here",
    keep: 5 /* number of backups to hold behind */,
  },
  auto: {
    cron: "00 00 00 * * *" /* https://crontab.cronhub.io/ */,
    timezone: "Africa/Nairobi",
  },
});

service.on("backup", (name, id) => {});
service.on("restore", (name, id) => {});

// local disk
service.backup({ saveTo: "./test.zip" }).then(() => {
  service.restore({ backupPath: "./test.zip" }).then(() => {});
});

// google drive
service.backup({ backupName: "test.zip" }).then(() => {
  service.restore({ backupName: "test.zip" }).then(() => {});
});

Package Sidebar

Install

npm i mongodb-gdrive-backup

Weekly Downloads

1

Version

1.0.1

License

ISC

Unpacked Size

10.9 kB

Total Files

8

Last publish

Collaborators

  • paulgrammer