use existing method for war end date; extend backup output

pull/21/head
HardiReady 2017-12-10 11:24:07 +01:00
parent b8ca870d8e
commit 1b66ae83a5
3 changed files with 2 additions and 2 deletions

View File

@ -129,7 +129,6 @@ if (process.env.NODE_ENV !== config.test.env) {
useMongoClient: true useMongoClient: true
}); });
mongoosePromise.then((db) => { mongoosePromise.then((db) => {
process.env.TZ = 'Europe/Berlin';
app.listen(config.test.port); app.listen(config.test.port);
console.log('Listening on port ' + config.test.port); console.log('Listening on port ' + config.test.port);
}) })

View File

@ -62,7 +62,7 @@ const parseWarLog = (lineArray, war) => {
if (line.includes('Endbudget')) { if (line.includes('Endbudget')) {
stats.war['endBudgetBlufor'] = transformMoneyString(budg[11]); stats.war['endBudgetBlufor'] = transformMoneyString(budg[11]);
stats.war['endBudgetOpfor'] = transformMoneyString(budg[14]); stats.war['endBudgetOpfor'] = transformMoneyString(budg[14]);
stats.war.endDate = new Date(budg[0].substr(0, budg[0].length - 1).split('/').join('-') + 'T0' + budg[5]); stats.war.endDate = getFullTimeDate(war.date, budg[5]);
} else if (line.includes('Startbudget')) { } else if (line.includes('Startbudget')) {
stats.war['budgetBlufor'] = transformMoneyString(budg[11]); stats.war['budgetBlufor'] = transformMoneyString(budg[11]);
stats.war['budgetOpfor'] = transformMoneyString(budg[14]); stats.war['budgetOpfor'] = transformMoneyString(budg[14]);

View File

@ -23,6 +23,7 @@ do
# provide date for restore process, if data import is needed # provide date for restore process, if data import is needed
if [ -z "$1" ] if [ -z "$1" ]
then then
echo "table ${i}"
mongoexport --db cc --collection $i --out ${DATE}/collections/${i}.json; mongoexport --db cc --collection $i --out ${DATE}/collections/${i}.json;
else else
mongoimport --db cc --collection $i --drop --file ${1}/collections/${i}.json mongoimport --db cc --collection $i --drop --file ${1}/collections/${i}.json