expressgy 2 years ago
parent 8a21fdd750
commit 12be24f7cf
  1. 2
      server.js

@ -52,7 +52,7 @@ function back(){
const cout = os.platform() == 'win32' ? '-r' : '>'
, filename = `back/BACKUP_${ database }_${ moment().format("YYYY_MM_DD_HH_mm_ss") }.sql`
console.log(cout, filename)
const backProcess = spawn('mysqldump',['-u'+user, '-p'+passwd, database, cout + filename]);
const backProcess = spawn('mysqldump',['-u'+user, '-p'+passwd, database, cout, filename]);
backProcess.stdout.on('data', data => console.log('Data : ', out(data)))
backProcess.stderr.on('data', data => console.log('Error: ', out(data)))
backProcess.on('close', code => {

Loading…
Cancel
Save