Running a Python script from crontab

Lawrence D'Oliveiro ldo at geek-central.gen.new_zealand
Wed Dec 3 18:34:59 EST 2008


In message <mailman.4867.1228330173.3487.python-list at python.org>, Philip
Semanchuk wrote:

> In my experience, the environment in which a cron job runs is
> different from the environment in which some command line scripts run...

Which is true, but again, cron should report the environment in the mail
message. For example, here are some headers from a recent run of the
maildir backup task I have scheduled twice a day:

    Subject: Cron <ldo at theon> $HOME/bin/backupdir $HOME/.maildir
    X-Cron-Env: <SHELL=/bin/sh>
    X-Cron-Env: <HOME=/home/ldo>
    X-Cron-Env: <PATH=/usr/bin:/bin>
    X-Cron-Env: <LOGNAME=ldo>
    X-Cron-Env: <USER=ldo>




More information about the Python-list mailing list