Ability to view stdout added

This commit is contained in:
alse
2019-11-26 21:55:45 -08:00
parent 9d5238b0aa
commit ee3aad8a2f
4 changed files with 24 additions and 6 deletions

View File

@@ -95,6 +95,7 @@ exports.set_crontab = function(env_vars, callback){
let stderr = path.join(cronPath, tab._id + ".stderr");
let stdout = path.join(cronPath, tab._id + ".stdout");
let log_file = path.join(exports.log_folder, tab._id + ".log");
let log_file_stdout = path.join(exports.log_folder, tab._id + ".stdout.log");
if(tab.command[tab.command.length-1] != ";") // add semicolon
tab.command +=";";
@@ -106,6 +107,11 @@ exports.set_crontab = function(env_vars, callback){
"; then date >> \"" + log_file + "\"" +
"; cat " + stderr + " >> \"" + log_file + "\"" +
"; fi";
crontab_string += "; if test -f " + stdout +
"; then date >> \"" + log_file_stdout + "\"" +
"; cat " + stdout + " >> \"" + log_file_stdout + "\"" +
"; fi";
}
if (tab.hook) {