I hope one of you folks can help - I'm still a little green with web2py and 
python, but am trying to get the CRON to work to run a script in our 
application.

I've tried both the unix cron, and the web2py crontab, but can't get either 
to execute my test script.
 
I also currently have crontab setup in the application as : 0-59/1 * * * * 
root *test_cron_jfh/main
I've scoured the web and have tried many different things.
 
Tried to run from the unix command -line, it does run python2.7  :
         $python2.7 /home/ameteq/webapps/web2py/web2py/web2py.py -S 
sms_test_protocol -M -R 
applications/sms_test_protocol/controllers/test_cron_jfh.py
         web2py Web Framework 
         Created by Massimo Di Pierro, Copyright 2007-2011
         Version 1.99.4 (2011-12-14 14:46:14) stable
         Database drivers available: SQLite3, pymysql, PostgreSQL
          $

While trying to run a  script from the unix command-line

     ./web2py.py -S sms_test_protocol -R 
*applications/sms_test_protocol/test_cron_jfh/ins_err

 

I get the following error :

 

      Traceback (most recent call last):

        File "./web2py.py", line 16, in ?

          import gluon.widget

        File "/home/ameteq/webapps/web2py/web2py/gluon/__init__.py", line 
15, in ?

          from globals import current

        File "/home/ameteq/webapps/web2py/web2py/gluon/globals.py", line 
21, in ?

          from html import xmlescape, TABLE, TR, PRE, URL

        File "/home/ameteq/webapps/web2py/web2py/gluon/html.py", line 30, 
in ?

          from utils import web2py_uuid, hmac_hash

        File "/home/ameteq/webapps/web2py/web2py/gluon/utils.py", line 12, 
in ?

          import hashlib

      ImportError: No module named hashlib

 
I've tried many different variations of each to no avail. 
 
I'm new to this environment.  Our site is hosted by webfaction.
 
Our wsgihandler.py has :
# change these parameters as required
LOGGING = False
SOFTCRON = False
import sys
import os
path = os.path.dirname(os.path.abspath(__file__))
os.chdir(path)
sys.path = [path]+[p for p in sys.path if not p==path]
sys.stdout=sys.stderr
import gluon.main
if LOGGING:
    application = gluon.main.appfactory(wsgiapp=gluon.main.wsgibase,
                                        logfilename='httpserver.log',
                                        profilerfilename=None)
else:
    application = gluon.main.wsgibase
if SOFTCRON:
    from gluon.settings import global_settings
    global_settings.web2py_crontype = 'soft'
 
 
Help is definitely appreciated.  I'll keep looking...
 
Thanks,

 

-jim

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to