Can't reproduce, apart from misplacing (back)slashes, not sure what it
can be. :( Just tried under winXP, from 1.59 source + patch above,
(even) with python 2.6. After that experiment I renamed the web2py dir
to "web py" (note the whitespace) and it worked identically. Note that
the we both mistyped the marker -> open("c:\\marker"... is the correct
form).
My tried and true crontab under windows:
*/1 * * * * root \python26\python
applications\examples\cron\vazeg.py
*/1 * * * * root *applications\examples
\cron\vazeg.py
*/1 * * * * root *applications/examples/
cron/vazeg.py
*/1 * * * * root *default/crontest
C:\web2py>\Python26\python.exe web2py.py -D 0
WARNING:root:no file locking
default applications appear to be installed already
web2py Enterprise Web Framework
Created by Massimo Di Pierro, Copyright 2007-2009
Version 1.59 (2009-03-16 13:10:16)
Database drivers available: SQLite3
choose a password:1
please visit:
http://127.0.0.1:8000
use "kill -SIGTERM 1072" to shutdown the web2py server
INFO:root:starting web server...
INFO:root:SSL is off
DEBUG:root:WEB2PY CRON: Trying to acquire lock
DEBUG:root:WEB2PY CRON: Locked
INFO:root:WEB2PY CRON (hard): Application: examples executing
\python26\python a
pplications\examples\cron\vazeg.py in C:\web2py at 2009-03-30
16:48:00.023000
WARNING:root:['\\python26\\python applications\\examples\\cron\
\vazeg.py']
INFO:root:WEB2PY CRON (hard): Application: examples executing
*applications\exam
ples\cron\vazeg.py in C:\web2py at 2009-03-30 16:48:00.085000
WARNING:root:['C:\\Python26\\python.exe', 'web2py.py', '-P', '-N', '-
M', '-S', '
examples', '-a', "'recycle'", '-R', 'applications\\examples\\cron\
\vazeg.py']
INFO:root:WEB2PY CRON (hard): Application: examples executing *default/
crontest
in C:\web2py at 2009-03-30 16:48:01.101000
DEBUG:root:WEB2PY CRON done
INFO:root:WEB2PY CRON Call returned: WARNING:root:crontest_script
DEBUG:root:WEB2PY CRON: Releasing cron lock
WARNING:root:['C:\\Python26\\python.exe', 'web2py.py', '-P', '-N', '-
M', '-S', '
examples/default/crontest', '-a', "'recycle'"]
...
On Mar 30, 3:07 pm, Iceberg <[email protected]> wrote:
> Try once more, still no cron at all. :-(
>
> I describe what I did here, so you can try to reproduce all my test,
> to see whether it will be any different at your machine.
>
> I am now using Windows XP Home Edition (should not matter), Python
> 2.5.4, web2py source 1.59, ORIGINAL cron.py. I create a brand new
> "test" app, then add this stuff.
>
> In cron/crontab:
> */1 * * * * root
> *applications/test/cron/trigger.py
>
> In cron/trigger.py:
> import urllib,logging,os,sys
> urllib.urlopen(t).read()
>
> In controllers/default.py:
> def index(): return {}
> def trigger():
> import logging,time
> logging.warn('Fired')
> open("C:\marker","a").write('%s\r\n'%time.ctime())
>
> Then, I visithttp://127.0.0.1:8000/testseveral times, once per
> minute, but see no C:\marker at all. If I
> visithttp://127.0.0.1:8000/test/default/trigger,
> it can be manually triggered.
>
> >_<
>
> On Mar30, 7:03pm, AchipA <[email protected]> wrote:
>
> > Can you check if the cron tasks really-really aren't executed as per
> > 1.1 ? Logging can play tricks on you in hardcron mode, as a lot of
> > things happen in separate threads. The easiest way is to do something
> > like open("C:\marker","w") and check if it got created or, if it does
> > not annoy you, winsound.Beep(400,400).
>
> > On Mar 29, 9:08 am, Iceberg <[email protected]> wrote:
>
> > > Hi Achipa,
>
> > > Sorry for delay in response. I managed to upgrade my Python2.4.4 to
> > > Python2.6.1 just now, so finally I can play web2py from source. Then I
> > > try your patch. The result is, mmmmmm, very strange.
>
> > > 1. First I am using Windows XP Home edition, Python 2.6.1, web2py
> > > source 1.59, ORIGINAL cron.py (trying to reproduce the problem, but):
>
> > > 1.1 I start "web2py.py -a1 -D0" but surprisingly see that cron jobs
> > > are not invoked at all. Not any cron-relative info is showed on the
> > > console, either. :-o
>
> > > 1.2 However, manually execute "web2py.py -C -D0", the external cron
> > > can work, NO MATTER the web2py is deployed in a directory with or
> > > without white space inside its path. :-/
>
> > > 2. Then, I try using same infrastructure as above, but replace the
> > > cron.py with your patch. Situation is same as above.
>
> > > 3. Later I give up Python2.6.1, reinstall a Python 2.5.4, then redo
> > > all the test above. Results remain the same.
>
> > > What should I do now?
>
> > > Sincerely,
> > > Iceberg, 2009-Mar-29, 14:19(PM), Sun
>
> > > On Mar25, 9:56pm, AchipA <[email protected]> wrote:
>
> > > > Ok, could you try replacing your web2py/gluon/contrib/cron.py with
>
> > > >http://bazaar.launchpad.net/%7Eachipa/web2py/cron/download/head%3A/cr...
>
> > > > and report back if this makes any difference ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---