[CentOS] how to set term environment for cronjobs?

Tue Sep 30 16:11:36 UTC 2008
Bill Campbell <centos at celestial.com>

On Tue, Sep 30, 2008, Rudi Ahlers wrote:
>Hi,
>
>I'm running a crontjob on CentOS 5.2 server, which then connects to a
>webpage to run some stuff. It has to run this way, since the webpage
>is on a Windows server, and the Windows scheduled tasks doesn't work
>as well.
>
>It seems like the cronjob is working fine, except that the email
>output worries me a bit.
>
>This is what I get on email,
...
>So, the question is, how do I set the terminal type for a cronjob?

There are many ways to do this depending on the type of program executed by
the cron job (e.g. shell script, perl, python, or compiled program).  One
way that will always work is to write a wrapper script that execs the real
script, something like:

#!/bin/sh
# set a terminal type that makes your application happy
TERM=dumb
export TERM
# set any other environment variables as necessary
exec /path/to/real/script

Bill
-- 
INTERNET:   bill at celestial.com  Bill Campbell; Celestial Software LLC
URL: http://www.celestial.com/  PO Box 820; 6641 E. Mercer Way
Voice:          (206) 236-1676  Mercer Island, WA 98040-0820
Fax:            (206) 232-9186

The trade of governing has always been monopolized by the most ignorant and
the most rascally individuals of mankind. -- Thomas Paine