backup-database
v1.1.0
Published
### Now backup database package support both aws and google storage.
Downloads
6
Readme
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();