Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

running web2py scheduler in production

I know that I can run the scheduler manually by using

python web2py.py -K myapp

But where should this be specified in production environment? I am using standard web2py deployment script for apache, on ubuntu.

like image 291
Euphorbium Avatar asked Dec 14 '22 16:12

Euphorbium


1 Answers

Just to round the picture. Using Debian or other Linux distributions after 2015, the way to go is systemd. For systemd the following steps have to be taken: Create the file /etc/systemd/system/web2py-sched.service Containing the following

[Unit]
Description=Web2Py scheduler service

[Service]
ExecStart=/usr/bin/python /home/www-data/web2py/web2py.py -K <yourapp>
Type=simple

[Install]
WantedBy=multi-user.target

Then install the service calling:

sudo systemctl enable /etc/systemd/system/web2py-sched.service 
like image 191
Sherlock70 Avatar answered Dec 17 '22 07:12

Sherlock70