Hi AchipA Another feature request, if the cron file is a python file, how about a cron option to open the file and do an exec on the file contents?
Thanks John Heenan On Jan 31, 12:33 pm, John Heenan <johnmhee...@gmail.com> wrote: > Hi AchipA > > Your cron is nice work and neatly deals with the messy side of > launching an independent OS process and waiting for it to finish. > > For those of us who do not wish to launch an independent process (to > keep down memory use) and are happy to stick with Python for cron > jobs, following is a request to add in the following feature to your > cron fpr web2py. > > Provide a mechanism to just perform a Python exec on a string > statment. > > For example a string statement might be > "import a; a.mycronaction()" > > Thanks > > John Heenan > > On Jan 31, 6:52 am, AchipA <attila.cs...@gmail.com> wrote: > > > Just to chime in, I'm still alive and preparing an update to cron as > > quite a few things changed since I last touched it. As for the > > questions - all cron modes support the * and ** syntax, and yes, cron > > files can be modified on the fly. > > > On Jan 26, 4:00 pm, mdipierro <mdipie...@cs.depaul.edu> wrote: > > > > I did not write cron personally and I am still trying to understand > > > some of it, Attila did. > > > I am in the looking at cron these days to treamline it a bit and I am > > > trying to understand better as it works. > > > > Since windows does not have cron, you should use web2py hardcron. It > > > should work on windows 7 but I have not tried it. The "root" is the > > > username that should run the cron task. It is only used by extcron and > > > ignored otherwise (but must be there, for compatibility of syntax). > > > > I am not sure if tasks staring with * or ** run under extcron so I > > > suggest not using pycron. Given hardcron you do not need pycron > > > anyway. > > > > Mind that this is in the process of being refactored a bit. Perhaps > > > you can help with testing and debugging so you can be sure it works as > > > you need it. > > > > On Jan 26, 4:27 am, Oguz Yarimtepe <oguzyarimt...@gmail.com> wrote: > > > > > Hi, > > > > > I was trying to use the cron property of web2py at my project. I am > > > > using web2py under windows 7. I had installed wamp server with mod_wsgi. > > > > According to the documentation it is suggested to use the external cron. > > > > I tried to test the soft cron issue so i added the below line to my > > > > application crontab > > > > > #crontab > > > > */2 * * * * root *decrease/ > > > > > and at the controllers directory the decrease file is as is > > > > > # coding: utf8 > > > > > def index(): > > > > > f=file("C:\\Users\\oguz\\hede.txt", "w+") > > > > f.write("ok") > > > > f.close() > > > > > return dict() > > > > > So when the application is loaded shouldn't i see the txt is created at > > > > every 2 minutes? > > > > > What is the usage of the root keyword at the crontab file? For windows > > > > application what should it be? > > > > > And if i want to use the external cron method, it says i should add a > > > > line to system cron file. This doesn't sound me so effective at my > > > > application so i will be prefering to use something like pycron. Anybody > > > > tested these things at windows 7? -- You received this message because you are subscribed to the Google Groups "web2py-users" group. To post to this group, send email to web...@googlegroups.com. To unsubscribe from this group, send email to web2py+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/web2py?hl=en.