Commit 83ad5e98 authored by nanahira's avatar nanahira Committed by GitHub

Create restart.js

parent 4f1dcf2b
var moment = require('moment');
var exec = require('child_process').exec;
var check = function() {
var now = moment();
if (now.hour() == 4 && now.minute() == 0) {
console.log("It is time NOW!");
exec("pm2 restart all");
}
else {
console.log(now.format());
setTimeout(check, 10000);
}
}
setTimeout(check, 60000);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment