How do I deploy the web2py scheduler for multiple apps?
ok I think both are possible, I settled on using a two file solution.
The complete files are as follows (note I've substituted <user>
with www-data
which is the actual user):
/etc/init/web2py-scheduler.app1.conf:
description "web2py task scheduler App1"start on (local-filesystems and net-device-up IFACE=eth0)stop on shutdownrespawn limit 8 60 # Give up if restart occurs 8 times in 60 seconds.exec sudo -u www-data python /home/www-data/web2py/web2py.py -K App1respawn
/etc/init/web2py-scheduler.app2.conf:
description "web2py task scheduler App2"start on (local-filesystems and net-device-up IFACE=eth0)stop on shutdownrespawn limit 8 60 # Give up if restart occurs 8 times in 60 seconds.exec sudo -u www-data python /home/www-data/web2py/web2py.py -K App2respawn
The solution with one file:
/etc/init/web2py-scheduler.conf:
description "web2py task scheduler"start on (local-filesystems and net-device-up IFACE=eth0)stop on shutdownrespawn limit 8 60 # Give up if restart occurs 8 times in 60 seconds.exec sudo -u www-data python /home/www-data/web2py/web2py.py -K App1,App2respawn
In the one file App1,App2
should NOT have a space in between.