mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-06 22:40:14 -05:00
Merge pull request #2939 from jomahoney/db-backup
Change DB backup location
This commit is contained in:
commit
c82cea3efe
1 changed files with 3 additions and 2 deletions
|
@ -14,6 +14,7 @@ var _ = require('lodash'),
|
|||
schema = require('../schema').tables,
|
||||
dataExport = require('../export'),
|
||||
utils = require('../utils'),
|
||||
config = require('../../config'),
|
||||
|
||||
schemaTables = _.keys(schema),
|
||||
|
||||
|
@ -136,7 +137,7 @@ function checkMySQLPostTable() {
|
|||
function backupDatabase() {
|
||||
return dataExport().then(function (exportedData) {
|
||||
// Save the exported data to the file system for download
|
||||
var fileName = path.resolve(__dirname + '/../exported-' + (new Date().getTime()) + '.json');
|
||||
var fileName = path.resolve(config().paths.contentPath + '/data/exported-' + (new Date().getTime()) + '.json');
|
||||
|
||||
return nodefn.call(fs.writeFile, fileName, JSON.stringify(exportedData));
|
||||
});
|
||||
|
@ -179,4 +180,4 @@ module.exports = {
|
|||
reset: reset,
|
||||
migrateUp: migrateUp,
|
||||
migrateUpFreshDb: migrateUpFreshDb
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue