Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

mongo db backup node js daily

spawn = require('child_process').spawn
let backupProcess = spawn('mongodump', [
    '--db=restaurantDB',
    '--archive=.',
    '--gzip'
    ]);

backupProcess.on('exit', (code, signal) => {
    if(code) 
        console.log('Backup process exited with code ', code);
    else if (signal)
        console.error('Backup process was killed with singal ', signal);
    else 
        console.log('Successfully backedup the database')
});
Comment

mongo db backup node js daily

mongodump --db=yourDatabaseName --archive=pathToStoreBackup/ --gzip
Comment

PREVIOUS NEXT
Code Example
Javascript :: documentUrlPatterns 
Javascript :: mogoose schema to add json as a property 
Javascript :: Adding A Property To BuiltIn Class In Javascript 
Javascript :: offline bot command discord.js 
Javascript :: express-js 
Javascript :: postgresql nodejs 
Javascript :: js function expression 
Javascript :: TypeError: expressValidator is not a function 
Javascript :: regex capture group example 
Javascript :: password 
Javascript :: comentar en javascript 
Javascript :: javascript this = that 
Javascript :: how to use array of object in react 
Javascript :: how to initialize an array in javascript 
Javascript :: stringbuffer javascript 
Javascript :: usesearchparams react router 
Javascript :: javascript callback function 
Javascript :: uncaught typeerror e.indexof is not a function jquery load 
Javascript :: javascript move element position 
Javascript :: disable js in chrome dev tools 
Javascript :: array example 
Javascript :: what are undeclared and undefined variables in javascript 
Javascript :: parse json java 
Javascript :: use state in className 
Javascript :: find the length and the last character of string in js 
Javascript :: python best practices example 
Javascript :: how does an if statement work 
Javascript :: Argument #1 ($client) must be of type AwsS3Client 
Javascript :: client.login discord.js 
Javascript :: javascript bigdecimal 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =