expressgy 2 years ago
parent 21e5c92bd7
commit 6640d6e9f7
  1. 2
      server.js

@ -51,7 +51,7 @@ function back(){
return new Promise(rec => { return new Promise(rec => {
const cout = os.platform() == 'win32' ? '-r' : '>' const cout = os.platform() == 'win32' ? '-r' : '>'
, filename = `back/BACKUP_${ database }_${ moment().format("YYYY_MM_DD_HH_mm_ss") }.sql` , filename = `back/BACKUP_${ database }_${ moment().format("YYYY_MM_DD_HH_mm_ss") }.sql`
// console.log(cout, filename) console.log(cout, filename)
const backProcess = spawn('mysqldump',['-h' + SERVERHOST, database, cout, filename]); const backProcess = spawn('mysqldump',['-h' + SERVERHOST, database, cout, filename]);
backProcess.stdout.on('data', data => console.log('Data : ', out(data))) backProcess.stdout.on('data', data => console.log('Data : ', out(data)))
backProcess.stderr.on('data', data => console.log('Error: ', out(data))) backProcess.stderr.on('data', data => console.log('Error: ', out(data)))

Loading…
Cancel
Save