Thanks very much for the help Massimo and Jonathan.

I found the script was working but it was creating the log in the main
web2py folder rather than applications/<app_name>/cron etc.

BRGDS,
Chris
p.s. web2py rocks!! It really takes the pain out of web
development :-)

On Jan 3, 5:36 pm, Jonathan Lundell <[email protected]> wrote:
> On Jan 3, 2011, at 9:20 AM, mdipierro wrote:
>
>
>
> > Yes they can. They should all run from the main web2py folder (do not
> > use os.chdir(...)!)
>
> Digression: I'd like to fix that eventually. It's not so bad to require the 
> cwd to be web2py for startup, but it shouldn't matter after that.
>
> > the only issue is that cron jobs do not have access to stdout so they
> > cannot print.
> > You can use the logging module or print to a file.
>
> That can be true of web2py in general. stdout is the console when web2py is 
> run from the command line, but in general (especially when it's started from 
> a system-startup rc file) there's no telling what stdout is--if indeed it's 
> anything at all.
>
>
>
> > Massimo
>
> > On Jan 3, 11:17 am, Christopher Blunt <[email protected]>
> > wrote:
> >> Hi,
> >> Can scripts invoked via cron have access to the local file system?
>
> >> As a test I created a script that I wish to run (via hardcron) every 5
> >> minutes that will dump out test data to a file. The script seems to be
> >> invoked by web2py cron thread but no output file is created?
>
> >> Also, can a controller or model access the local file system?
>
> >> BRGDS,
> >> Chris
> >> p.s. I've only just started to use Web2py so sorry if these seem silly
> >> questions

Reply via email to