update
This commit is contained in:
parent
8cac688ebd
commit
c33e3065ec
2 changed files with 15 additions and 5 deletions
13
day_init.js
13
day_init.js
|
@ -1,8 +1,13 @@
|
||||||
|
// v1.1
|
||||||
var db = connect("192.168.0.1:27017/lastlogin");
|
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 dd = function(x) { var s = x.toString(); if(s.length > 1){return s;} else { return "0"+s;}}
|
||||||
var now = new Date();
|
var now = new Date();
|
||||||
var col = now.getFullYear() + dd(now.getMonth()+1) + dd(now.getDate())
|
var col = now.getFullYear() + dd(now.getMonth()+1) + dd(now.getDate())
|
||||||
print("creating index: ll_"col.slice(2));
|
print("creating index: ll_",col.slice(2));
|
||||||
db.getCollection("ll_"+col.slice(2)).createIndexes([{"date": 1},{"country": 1},{"user": 1,"date": -1}])
|
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}])
|
||||||
|
|
|
@ -24,4 +24,9 @@
|
||||||
#
|
#
|
||||||
# m h dom mon dow command
|
# 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
|
||||||
|
|
Loading…
Add table
Reference in a new issue