new:dev:support run the jobs manually

This commit is contained in:
chenqiyu
2018-05-07 18:40:41 +08:00
parent a84171ac11
commit bb7f57e903
5 changed files with 26 additions and 0 deletions

View File

@@ -74,6 +74,15 @@ exports.get_crontab = function(_id, callback) {
});
};
exports.runjob = function(_id, callback) {
db.find({_id: _id}).exec(function(err, docs){
var res = docs[0];
exec(res.command, function(error, stdout, stderr){
console.log(stdout);
});
});
};
// Set actual crontab file from the db
exports.set_crontab = function(env_vars, callback){
exports.crontabs( function(tabs){