Skip to content

Commit

Permalink
MINOR: Add add_db_backup.js to be seen by eslint (#244)
Browse files Browse the repository at this point in the history
  • Loading branch information
radomir-sebek authored and kipliklotrika committed Jun 21, 2018
1 parent d4d6fcb commit 7b6d0dc
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Expand Up @@ -26,4 +26,5 @@ Envoy.blade.php
!/data/wallet.dat/.gitkeep
/modules/Database/system.db
@kadenceproject
test.*
test.*
db_backup/*
7 changes: 3 additions & 4 deletions add_db_backup.js
@@ -1,12 +1,11 @@
const fs = require('fs');
const rimraf = require('rimraf');
const exec = require('child_process').exec;
const { exec } = require('child_process');

const d = new Date();
const todaysDate = `${d.getFullYear()}-${d.getMonth() + 1}-${d.getDate()}-${d.getHours()}:${d.getMinutes()}:${d.getSeconds()}`;



if (fs.existsSync('./db_backup')) {
console.log('Database backup directory already exists');
} else {
Expand Down Expand Up @@ -82,7 +81,7 @@ if (fs.existsSync(`./db_backup/arango_db/arango-db-${todaysDate}`)) {
setTimeout(() => {
const files = fs.readdirSync('./db_backup/sqllite_db');
var i;
for (i = 0; i < files.length; i++) {
for (i = 0; i < files.length; i += 1) {
const stats = fs.statSync(`./db_backup/sqllite_db/${files[i]}`);

const ctime = new Date((stats.ctime));
Expand All @@ -107,7 +106,7 @@ setTimeout(() => {
setTimeout(() => {
const files = fs.readdirSync('./db_backup/arango_db');
var i;
for (i = 0; i < files.length; i++) {
for (i = 0; i < files.length; i += 1) {
const stats = fs.statSync(`./db_backup/arango_db/${files[i]}`);

const ctime = new Date((stats.ctime));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -9,7 +9,7 @@
"test:api": "nyc mocha --recursive test/api/*.test.js",
"start": "node node_version_check.js && node ot-node.js",
"config": "rm modules/Database/system.db &> /dev/null || true && touch modules/Database/system.db; ./node_modules/.bin/sequelize db:migrate; ./node_modules/.bin/sequelize db:seed:all",
"lint": "./node_modules/.bin/eslint --quiet migrations/ models/ modules/ seeders/ test/ ot-node.js .eslintrc.js isStartHealthy.js node_version_check.js switchDatabase.js",
"lint": "./node_modules/.bin/eslint --quiet migrations/ models/ modules/ seeders/ test/ ot-node.js .eslintrc.js isStartHealthy.js node_version_check.js switchDatabase.js add_db_backup.js",
"arango": "/usr/local/opt/arangodb/sbin/arangod &",
"db_backup": " node add_db_backup.js"
},
Expand Down

0 comments on commit 7b6d0dc

Please sign in to comment.