0
Fork 0
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:
Hannah Wolfe 2014-06-12 21:35:55 +02:00
commit c82cea3efe

View file

@ -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
};
};