mirror of
https://github.com/MikroWizard/mikroman.git
synced 2025-06-26 15:18:37 +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
|
taskid=task.id
|
||||||
crontab = CronTab(user=True)
|
crontab = CronTab(user=True)
|
||||||
directory=Path(app.root_path).parent.absolute()
|
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)
|
comment = "MikroWizard task #" + "taskid:{};".format(taskid)
|
||||||
jobs = crontab.find_comment(comment)
|
jobs = crontab.find_comment(comment)
|
||||||
if len(list(jobs)) > 0:
|
if len(list(jobs)) > 0:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue