How to tell when a script is executed by cron ?

Ian Bicking ianb at colorstudy.com
Tue Feb 4 19:57:33 EST 2003


On Tue, 2003-02-04 at 18:41, Simon Dobner wrote:
> I want to know how to tell if a script is being executed in the background
> by cron, as opposed to running in the foreground from the command prompt.

The easiest way would be to use a command-line option in your crontab
that you don't use otherwise.

-- 
Ian Bicking   ianb at colorstudy.com  http://colorstudy.com
PGP:  gpg --keyserver pgp.mit.edu --recv-keys 0x9B9E28B7
4869 N. Talman Ave., Chicago, IL 60625      773-275-7241





More information about the Python-list mailing list