I am trying to put a python script on a VPS running CentOS 7, that crawls some stock data online from a web service. What I want to do is to set this script as an OS service that start/stops at a specific time.
How can I do it?
EDIT:this is the result of systemctl status python-script
Loaded: loaded (/etc/systemd/system/python-script.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Sat 2020-05-16 01:11:50 +0430; 15h ago
Main PID: 854 (code=exited, status=1/FAILURE)
May 16 01:11:43 boiga.server1.more.com systemd[1]: Started Python Script Serv...
May 16 01:11:50 boiga.server1.more.com python3[854]: Traceback (most recent c...
May 16 01:11:50 boiga.server1.more.com python3[854]: File "/root/script.py", ...
May 16 01:11:50 boiga.server1.more.com python3[854]: await (websocketConnect())
May 16 01:11:50 boiga.server1.more.com python3[854]: NameError: name 'await' ...
May 16 01:11:50 boiga.server1.more.com systemd[1]: python-script.service: mai...
May 16 01:11:50 boiga.server1.more.com systemd[1]: Unit python-script.service...
May 16 01:11:50 boiga.server1.more.com systemd[1]: python-script.service failed.
Hint: Some lines were ellipsized, use -l to show in full.