Re: Terminal type and Cron

From: Jean-Pierre Radley (jpr_at_jpr.com)
Date: 10/17/03


Date: 17 Oct 2003 12:43:15 -0400
To: bv@wjv.com

Bill Vermillion typed (on Fri, Oct 17, 2003 at 04:15:09PM +0000):
| In article <20031017051911.GA8420@alexis.mi.celestial.com>,
| Bill Campbell <bill@celestial.com> wrote:
| >On Thu, Oct 16, 2003, Yoram wrote:
|
| >>I added a new task in the Crontab scheduler and everytime it runs I
| >>get an error "Terminal type not found".
|
| >>The task is a shell script I wrote that runs a report generator to
| >>create a report file (dreport of FilePro). I do redirect all the
| >>output to /dev/null.
|
| >>My question is: Does anyone knows how to set a terminal type for an
| >>application being run by Cron?
|
| >The usual way is to set it in a shell script executed by cron:
|
| >#!/bin/sh
| >TERM=xterm; export TERM
| ># rest of your script.
|
| >One way to make sure you get a realistic set of environment variables is to
| >use the output of the ``env'' command to get the environment from a shell
| >session: ``env > myscript.sh'' then edit myscript.sh appropriately.
|
| Here's an idea for an enhancement. Some of the OpenSource systems
| actually ship with variables defined in the root crontab
| of PATH, SHELL, and HOME. [the latter pointing to the log area].
| Those are at the top of the crontab. It could take care of
| questions like this. Add TERM and make it generice like VT100
| and you'd be pretty well covered from forgetting any environemental
| variables a program would need.

Starting in OSR 5.0.7, /etc/default/cron lets you define any environemnt
variables you wish.

-- 
JP


Relevant Pages

  • Re: cron quarterly
    ... the system crontab. ... because the environment in cron is a heck of a lot more restrictive ... Use the 'set' command to see what your ... environment looks like, and make a cron job to run that same command, ...
    (comp.unix.admin)
  • Re: Help in Crontab Shell Script?
    ... I wanted to write a shell script with Crontab & cron. ... command and read up on the meaning of the various ...
    (comp.os.linux.misc)
  • Re: Cron to email notification of ftp file upload?
    ... >> I like the find command as a nightly cron man find ... For cron job you'll need to know vi and crontab: ... # run this shell script containing find commands ...
    (alt.os.linux)
  • Re: Where are user crons?
    ... I moved the shell script, ... did not document) how I set up the cron job. ... that looks like a crontab. ... The apropos command is quite Handy and shows related man pages: ...
    (GNOME)
  • Re: script wont execute from cron, but will from command line
    ... >>use these to set up an explicit environment for a process. ... > in it and it won't even execute that. ... Presumably you are using "crontab ... perhaps there's something in it that's confusing cron. ...
    (comp.unix.aix)