To be honest, that's the way I do it since long time ago, never thought 
about changing it. But now that you've pointed that out, I've taken another 
look to the book.
The book explains how to run the scheduler via upstart [1], but I'm using 
CentOS 7, which uses *systemd* instead of *upstart.*

In case it helps someone else, here is what I did to run the scheduler via 
systemd:


1) I've created the file */home/myuser/web2py/scheduler.sh* with this 
content:

#!/bin/bash
/bin/python /home/myuser/web2py/web2py.py -K myapp


2) Then I've created the file */etc/systemd/system/scheduler.service* with 
this content:

[Unit]
 Description=web2py Scheduler

[Service]
 ExecStart=/home/myuser/web2py/scheduler.sh
 User=nginx

[Install]
 WantedBy=default.target


3) Then run this commands to start the service:
sudo systemctl daemon-reload
sudo systemctl start scheduler

If you need to check the status of the service, run:
sudo systemctl status scheduler

If you need to enable the service to run on startup, run:
sudo systemctl enable scheduler


Thank you very much Dave for your time!
Best regards,
Lisandro.



[1] 
http://web2py.com/books/default/chapter/29/13/deployment-recipes#Start-the-scheduler-as-a-Linux-service-upstart-


El lunes, 13 de agosto de 2018, 16:18:57 (UTC-3), Dave S escribió:
>
>
>
> On Monday, August 13, 2018 at 5:43:13 AM UTC-7, Lisandro wrote:
>>
>> Thanks for that clarification.
>> The files were being created every minute, in concordance with the 
>> frequence I run the scheduler.
>> I was able to solve it adding ">/dev/null 2>&1" to the end of the line in 
>> crontab, so it ended up like this:
>>
>> * * * * * python /var/www/medios/web2py.py -K webmedios >/dev/null 2>&1
>>
>> That did the trick, and those files are not created anymore.
>> Thank you for your help!
>>
>> Best regards,
>> Lisandro.
>>
>
> I don't understand why you are starting the scheduler every minute, 
> instead of starting it once, and then scheduling tasks to repeat on a 1 
> minute schedule.
>
> /dps
>  
>

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to