Author Topic: How to schedule a python script with Flask at startup  (Read 2550 times)

0 Members and 1 Guest are viewing this topic.

Offline SPRXTopic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: au
How to schedule a python script with Flask at startup
« on: November 11, 2021, 06:16:59 am »

Hi,
I am trying to schedule a python script with 'Flask' module import and use in the programe for Webserver. Python code (with Flsk) runs ok if you run it manually. I am running flask 2.2,  Ubuntu 18.04, Python 3.6.9 on a Jetson Nano.

It sound very simple to use CRONTAB or systemctl to schedule the program, however non seems to work with me as soon as i includ the import flask in the python code. I spent lot of time trying to figure the issue or the solution with no success.

Any suggestion/ direction on how to get it sorted if someone has come across similar issue? 
 

Online tunk

  • Super Contributor
  • ***
  • Posts: 1410
  • Country: no
Re: How to schedule a python script with Flask at startup
« Reply #1 on: November 11, 2021, 11:10:13 am »
I think they are run in a limited shell.
If you haven't already done it, try to use full paths for commands and files.
 

Offline SPRXTopic starter

  • Regular Contributor
  • *
  • Posts: 66
  • Country: au
Re: How to schedule a python script with Flask at startup
« Reply #2 on: November 11, 2021, 12:27:12 pm »

Thanks Tunk, I hv already tried that too without any luck  |O
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf

 

-->