Problem running Python script as cron job

Michael Hudson mwh21 at cam.ac.uk
Mon Apr 10 21:49:27 CEST 2000


"William R. Dickson" <wrd at awenet.com> writes:

> In article <38EE41F4.8050708 at gmx.net>, Per Kistler <kistler at gmx.net> 
> wrote:
> 
> > Hi Bill
> > 
> > Try stderr?
> > /path/prog > /path/log 2>&1
> > 
> > Maybe it spits some errors?
> 
> Tried that, but I still wind up with an empty log.  Anyway to force it 
> to write immediately rather than buffering?

[mwh21 at atrus mwh21]$ python --bleargh
Unknown option: --
usage: python [option] ... [-c cmd | file | -] [arg] ...
Options and arguments (and corresponding environment variables):
-d     : debug output from parser (also PYTHONDEBUG=x)
-i     : inspect interactively after running script, (also PYTHONINSPECT=x)
         and force prompts, even if stdin does not appear to be a terminal
-O     : optimize generated bytecode (a tad; also PYTHONOPTIMIZE=x)
-OO    : remove doc-strings in addition to the -O optimizations
-S     : don't imply 'import site' on initialization
-t     : issue warnings about inconsistent tab usage (-tt: issue errors)
-u     : unbuffered binary stdout and stderr (also PYTHONUNBUFFERED=x)
-v     : verbose (trace import statements) (also PYTHONVERBOSE=x)
-x     : skip first line of source, allowing use of non-Unix forms of #!cmd
-X     : disable class based built-in exceptions
-c cmd : program passed in as string (terminates option list)
file   : program read from script file
-      : program read from stdin (default; interactive mode if a tty)
arg ...: arguments passed to program in sys.argv[1:]
Other environment variables:
PYTHONSTARTUP: file executed on interactive startup (no default)
PYTHONPATH   : ':'-separated list of directories prefixed to the
               default module search path.  The result is sys.path.
PYTHONHOME   : alternate <prefix> directory (or <prefix>:<exec_prefix>).
               The default module search path uses <prefix>/python1.5.

so that'll be `python -u' then ...

Cheers,
M.

-- 
  ... but I guess there are some things that are so gross you just have
  to forget,  or it'll destroy something within you.  perl is the first
  such thing I have known.                 -- Erik Naggum, comp.lang.lisp



More information about the Python-list mailing list