backup-database

1.1.0 • Public • Published

Usage example

Now backup database package support both aws and google storage.

import DatabaseBackupService from 'backup-database';

const databaseConfig = {
  name: 'your_database_name' //string or array[],
  password: 'your_database_password',
  host: 'your_database_host',
  user: 'your_database_user',
  port: 'your_database_port'
};

const optionalConfig = {
  folderName: 'backup_database', //google drive folder name or aws bucket name
  timer: '*/5 * * * *', //cron job timer format
  isLogs: false, //for app and error logs
};

const storageConfig = {
  type: '', // google or aws// default: aws
  // google drive config
  clientId: 'your_google_drive_client_id',
  clientSecret: 'your_google_drive_client_secret',
  redirectUri: 'your_google_drive_redirect_uri',
  refreshToken: 'your_google_drive_refresh_token'
  // aws config
  clientId: 'your_aws_access_key',
  clientSecret: 'your_aws_secret_key',
  endpoint: 'your_aws_endpoint',
};

const databaseBackup = new DatabaseBackupService(databaseConfig, storageConfig, optionalConfig);
databaseBackup.start();

Readme

Keywords

none

Package Sidebar

Install

npm i backup-database

Weekly Downloads

2

Version

1.1.0

License

ISC

Unpacked Size

17.7 kB

Total Files

7

Last publish

Collaborators

  • shubham_lohar