From c33e3065ec4ad0f53bbb4156f78fcba620f15e3c Mon Sep 17 00:00:00 2001 From: Michele Date: Wed, 18 Jul 2018 13:29:44 +0200 Subject: [PATCH] update --- day_init.js | 13 +++++++++---- sys/llmongo.cron | 7 ++++++- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/day_init.js b/day_init.js index 1314370..b48bf64 100644 --- a/day_init.js +++ b/day_init.js @@ -1,8 +1,13 @@ +// v1.1 var db = connect("192.168.0.1:27017/lastlogin"); -//var conn = new Mongo("192.168.0.1"); -//var db = conn.getDB("lastlogin"); var dd = function(x) { var s = x.toString(); if(s.length > 1){return s;} else { return "0"+s;}} var now = new Date(); var col = now.getFullYear() + dd(now.getMonth()+1) + dd(now.getDate()) -print("creating index: ll_"col.slice(2)); -db.getCollection("ll_"+col.slice(2)).createIndexes([{"date": 1},{"country": 1},{"user": 1,"date": -1}]) \ No newline at end of file +print("creating index: ll_",col.slice(2)); +db.getCollection("ll_"+col.slice(2)).createIndexes([{"date": 1},{"country": 1},{"user": 1,"date": -1}]) +var db = connect("192.168.0.1:27017/katamail"); +var dd = function(x) { var s = x.toString(); if(s.length > 1){return s;} else { return "0"+s;}} +var now = new Date(); +var col = now.getFullYear() + dd(now.getMonth()+1) + dd(now.getDate()) +print("creating index: ll_",col.slice(2)); +db.getCollection("ll_"+col.slice(2)).createIndexes([{"date": 1},{"country": 1},{"user": 1,"date": -1}]) diff --git a/sys/llmongo.cron b/sys/llmongo.cron index d83b17f..0066f34 100644 --- a/sys/llmongo.cron +++ b/sys/llmongo.cron @@ -24,4 +24,9 @@ # # m h dom mon dow command -*/10 * * * * /opt/llmongo/start.sh > /dev/null +### lastlogin import +*/3 * * * * /opt/llmongo/run.sh > /dev/null 2>&1 +*/5 * * * * /opt/llmongo/katamail.sh > /dev/null 2>&1 +05 * * * * /opt/impmongo/run.sh > /dev/null 2>&1 +### lastlogin create indexes +00 01 * * * /opt/mongodb/mongo.sh -script /data/day_init.js >> /opt/mongodb/day_init.log 2>&1