mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-06-21 12:28:59 +02:00
send task logs to logfile
This commit is contained in:
parent
f2b59ea421
commit
d6fbf23067
1 changed files with 3 additions and 3 deletions
|
@ -112,7 +112,7 @@ def user_tasks_create():
|
|||
taskid=task.id
|
||||
crontab = CronTab(user=True)
|
||||
directory=Path(app.root_path).parent.absolute()
|
||||
command = "python3 {}/task_run.py {}".format(directory,taskid)
|
||||
command = "/usr/local/bin/python3 {}/task_run.py {} >> /var/log/cron.log 2>&1".format(directory,taskid)
|
||||
comment = "MikroWizard task #" + "taskid:{};".format(taskid)
|
||||
jobs = crontab.find_comment(comment)
|
||||
if len(list(jobs)) > 0:
|
||||
|
@ -195,8 +195,8 @@ def user_tasks_edit():
|
|||
crontab.remove(jobs)
|
||||
crontab.write()
|
||||
job = crontab.new(command=command,comment=comment)
|
||||
job.setall(cron)
|
||||
crontab.write()
|
||||
job.setall(cron)
|
||||
crontab.write()
|
||||
db_syslog.add_syslog_event(get_myself(), "Task","Edit", get_ip(),get_agent(),json.dumps(input))
|
||||
return buildResponse([{'status': 'success',"taskid":taskid}],200)
|
||||
except Exception as e:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue