Re: [web2py] Re: Cron doesn't work for me...
Thanks! On Tue, Mar 15, 2011 at 1:06 PM, VP wrote: > I answered your email. Briefly (on Linux/Unix): > > + Use "crontab -l" to see your cron entries. > > + Use "crontab -e" to create/edit cron entries. > > + Google / wikipedia for cron syntax. To execute a URL (e.g. web2py > controller, you can either use wget or curl). > > > > > On Mar 15, 8:05 am, Tito Garrido wrote: > > Hi VP! > > > > How did you use the system cron? I'm wondering how can I specify the > > function that I want to execute... > > > > Regards, > > > > Tito > > > > On Tue, Mar 15, 2011 at 1:53 AM, VP wrote: > > > Cron didn't work for me either, so I used the system cron. > > > > > One question I have though is why "root" when web2py is run as www- > > > data? > > > > -- > > > > Linux User #387870 > > . > > _/_õ|__| > > ..º[ .-.___.-._| . . . . > > .__( o)__( o).:___ > -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___
Re: [web2py] Re: Cron doesn't work for me...
Hi VP! How did you use the system cron? I'm wondering how can I specify the function that I want to execute... Regards, Tito On Tue, Mar 15, 2011 at 1:53 AM, VP wrote: > Cron didn't work for me either, so I used the system cron. > > One question I have though is why "root" when web2py is run as www- > data? -- Linux User #387870 . _/_õ|__| ..º[ .-.___.-._| . . . . .__( o)__( o).:___
Re: [web2py] Re: cron doesn't work
On Feb 17, 2011, at 11:24 AM, Massimo Di Pierro wrote: > > How much memory do you have? can you check with top memory > consumption? > Do you cron jobs take long time? Could be a recursion problem, too. > > On Feb 17, 10:45 am, LightOfMooN wrote: >> if it runs with python web2py.py -i 127.0.0.1 -p 8000 >> it works fine at once, and after minute: >> >> Exception in thread Thread-15: >> Traceback (most recent call last): >> File "/usr/lib/python2.6/threading.py", line 532, in >> __bootstrap_inner >> self.run() >> File "/home/www-data/web2py/gluon/newcron.py", line 220, in run >> shell=self.shell) >> File "/usr/lib/python2.6/subprocess.py", line 633, in __init__ >> errread, errwrite) >> File "/usr/lib/python2.6/subprocess.py", line 1049, in >> _execute_child >> self.pid = os.fork() >> OSError: [Errno 12] Cannot allocate memory >> >> If it runs with >> sudo -u www-data nohup python web2py.py -i 127.0.0.1 -p 8000 >> or nohup ./web2py.py >> it also works fine once, and not even more. >> >> There is error in nohup.out: >> >> web2py Enterprise Web Framework >> Created by Massimo Di Pierro, Copyright 2007-2011 >> Version 1.92.1 (2011-02-16 15:04:40) >> Database drivers available: SQLite3, pymysql, PostgreSQL >> Starting hardcron... >> choose a password:Traceback (most recent call last): >> File "web2py.py", line 19, in >> gluon.widget.start(cron=True) >> File "/home/www-data/web2py/gluon/widget.py", line 860, in start >> options.password = raw_input('choose a password:') >> IOError: [Errno 9] Bad file descriptor >> >> so I tried to run it with -a "mypassword" >> and have again the same error in nohup.out: >> >> Exception in thread Thread-15: >> Traceback (most recent call last): >> File "/usr/lib/python2.6/threading.py", line 532, in >> __bootstrap_inner >> self.run() >> File "/home/www-data/web2py/gluon/newcron.py", line 220, in run >> shell=self.shell) >> File "/usr/lib/python2.6/subprocess.py", line 633, in __init__ >> errread, errwrite) >> File "/usr/lib/python2.6/subprocess.py", line 1049, in >> _execute_child >> self.pid = os.fork() >> OSError: [Errno 12] Cannot allocate memory
Re: [web2py] Re: cron doesn't work
On Feb 17, 2011, at 7:29 AM, LightOfMooN wrote: > > nohup web2py.py -i 127.0.0.1 -p 8000 & > raises error: >nohup: cannot run comand 'web2py.py': No such file or directory. > ofc, I try to run it in web2py catalog. Try either: nohup ./web2py.py ... or: python web2py.py ... > > On 17 фев, 19:29, Massimo Di Pierro > wrote: >> if apache manages start and stop of web2py threads you cannot use cron >> inside apache. This does not mean you cannot use web2py cron. You just >> have to start a web2py instance manually: >> >> nohup web2py.py -i 127.0.0.1 -p 8000 & >> >> On Feb 16, 9:19 am, LightOfMooN wrote: >> >> >> >> >> >> >> >>> Hello >>> I have web2py installed with setup-web2py-ubuntu.sh >>> It runs with Apache mod_wsgi. >> >>> Crontab of myapp is: >>> */1 * * * * root *cron/test >> >>> And function: >>> def test(): >>> shop = db(db.shops.id==8).select().first() >>> new = shop.daystodelete + 1 >>> shop.update_record(daystodelete=new) >>> db.commit() >>> return 'done' >>> test() >> >>> manually function works fine. But not with cron. Seems it's not >>> working. >>> Any ideas? Thx