<commit_before>var client = require("redis").createClient(6378);
var cronJob = require('cron').CronJob;
var sys = require('sys');
var exec = require('child_process').exec;
var sent = 0;
var sentArr = ["cpu", "mem", "net", "dis"];

new cronJob('6,18,30,42,56 * * * * *', function(){
  client.save();
  var ts = new Date().getTime();
  var fileN = ts + "d.rdb";
  console.log(fileN);

  var cmd = "cp /opt/tools/redis/redis-2.6.14/src/thedump.rdb /opt/tools/redis/redis-2.6.14/src/" + sentArr[sent] + "/"  + fileN;
  sent = (sent +1) % 5;
  console.log("command   " + cmd);

  var child = exec(cmd, function(error, stdout, stderr) { });
  var cmd2 = "rm /opt/tools/redis/redis-2.6.14/src/thedump.rdb ";
  var child2 = exec(cmd2, function(error, stdout, stderr) { });

  client.keys("*", function (err, keys) {
    keys.forEach(function(key , pos) {
      client.migrate("localhost", 6381, key, 0, 1000);
    });
  });

  console.log(ts);
}, null, true);<commit_msg>Update controller.js<commit_after>var client = require("redis").createClient(6378);
var cronJob = require('cron').CronJob;
var sys = require('sys');
var exec = require('child_process').exec;
var sent = 0;
var sentArr = ["cpu", "mem", "net", "dis"];

new cronJob('6,18,30,42,56 * * * * *', function() {
  client.save();
  var ts = new Date().getTime();
  var fileN = ts + "d.rdb";
  console.log(fileN);

  var cmd = "cp /opt/tools/redis/redis-2.6.14/src/thedump.rdb " + 
            "/opt/tools/redis/redis-2.6.14/src/" + sentArr[sent] +
            "/"  + fileN;
  sent = (sent +1) % 5;
  console.log("command   " + cmd);

  var child = exec(cmd, function(error, stdout, stderr) { });
  var cmd2 = "rm /opt/tools/redis/redis-2.6.14/src/thedump.rdb ";
  var child2 = exec(cmd2, function(error, stdout, stderr) { });

  client.keys("*", function (err, keys) {
    keys.forEach(function(key , pos) {
      client.migrate("localhost", 6381, key, 0, 1000);
    });
  });

  console.log(ts);
}, null, true);
{'fraction_non_alphanumeric': 0.21283095723014256, 'fraction_numerical': 0.04073319755600815, 'mean_word_length': 3.4965675057208236, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6917361', 'n_tokens_mistral': 812, 'n_tokens_neox': 762, 'n_words': 154}