-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathschedule.js
86 lines (84 loc) · 2.58 KB
/
schedule.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const spawn = require('child_process').spawn;
const fs = require('fs');
const schedule = require('node-schedule');
const { r, log } = require('./src/helpers');
const firstRun = r(15, 20);
const secondRun = r(43, 48);
schedule.scheduleJob(' 16 23,1,3,5,7 * * *', () => {
let now = new Date().toLocaleString();
console.log(now + ' running dks.js');
spawn('node', ['dks.js']);
});
// /* DAY TIME */
// /* 11:25 AM */
// schedule.scheduleJob(' 25 11 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['dks.js']);
// });
// /* 11:37 AM */
// schedule.scheduleJob(' 37 11 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running hb.js');
// spawn('node', ['hb.js']);
// });
// /* OVER NIGHT
// schedule.scheduleJob(' 20 20 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['dks.js']);
// });
// ///// 9
// schedule.scheduleJob(' 15 21 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['dks.js']);
// });
// // 10: PM
// schedule.scheduleJob(' 19 22 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['hb.js']);
// });
// // 11: PM
// schedule.scheduleJob(' 13 23 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['dks.js']);
// });
// //// 12: AM
// schedule.scheduleJob(' 23 0 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['hb.js']);
// });
// //// 1: AM
// schedule.scheduleJob(' 33 1 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['dks.js']);
// });
// ////// 2:51 AM
// schedule.scheduleJob(' 37 2 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['hb.js']);
// });
// //// 3:53 AM
// schedule.scheduleJob(' 41 3 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['dks.js']);
// });
// ////// 4:56 AM
// schedule.scheduleJob(' 30 4 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['hb.js']);
// });
// //// 5:59 AM
// schedule.scheduleJob(' 45 5 * * *', () => {
// let now = new Date().toLocaleString();
// console.log(now + ' running dks.js');
// spawn('node', ['dks.js']);
// });*/