module.exports = function(database) {
// --------------------------------------------------------------------------------------
  const CronJob = require('cron').CronJob;
  const mail = require('./mail');
  const failed_logins = require('./cron/failed_logins.js');
  const mac_count = require('./cron/mac_count.js');
  const roaming = require('./cron/roaming.js');
  const service_state = require('./cron/service_state.js');
  const users_mac = require('./cron/users_mac.js');
  const heat_map = require('./cron/heat_map.js');
  const shared_mac = require('./cron/shared_mac.js');
  const request = require('./request');
  const config = require('./config/config.js');
// --------------------------------------------------------------------------------------
  new CronJob('0 00 06 1 * *', function() {     // run once a month
    mail.send_mail_to_realm_admins(database, request.get_failed_logins_monthly, config.failed_logins_lines);
  }, null, true, 'Europe/Prague');
// --------------------------------------------------------------------------------------
  // run once a day
  // should be run at more than Date.getTimezoneOffset(); [javascript method] minutes from midnight
  // to prevent inconsistent data - localtime/UTC conversion issue
// --------------------------------------------------------------------------------------
  new CronJob('0 05 02 * * *', function() {     // run at 02:05:00
    failed_logins.process_current_data(database);
  }, null, true, 'Europe/Prague');

  new CronJob('0 15 02 * * *', function() {     // run at 02:15:00
    mac_count.process_current_data(database);
  }, null, true, 'Europe/Prague');

  new CronJob('0 20 02 * * *', function() {     // run at 02:20:00
    roaming.process_current_data(database);
  }, null, true, 'Europe/Prague');

  new CronJob('0 25 02 * * *', function() {     // run at 02:25:00
    shared_mac.process_current_data(database);
  }, null, true, 'Europe/Prague');

  new CronJob('0 35 02 * * *', function() {     // run at 02:35:00
    heat_map.process_current_data(database);
  }, null, true, 'Europe/Prague');


// --------------------------------------------------------------------------------------
  // mac to user mapping is run more often
  new CronJob('0 */15 * * * *', function() {   // every 15 minutes
    users_mac.process_current_data(database, 900); // every 15 minutes
  }, null, true, 'Europe/Prague');

// --------------------------------------------------------------------------------------

  // TODO - automatic data retention -> delete older data:
  // logs itself after a year ?
  // invalid data after .. ?
  // 
}
// --------------------------------------------------------------------------------------

@@ -566,32 +566,88 @@
 hared_mac.js');%0A
+  const succ_logins = require('./cron/succ_logins.js');%0A
   const request 
@@ -2049,24 +2049,175 @@
 at 02:35:00%0A
+    succ_logins.process_current_data(database);%0A  %7D, null, true, 'Europe/Prague');%0A%0A  new CronJob('0 40 02 * * *', function() %7B     // run at 02:40:00%0A
     heat_map

use succ logins cron task