crontab for ordinary users
Tin Le
tin at smsc.sony.com
Wed Oct 17 05:10:21 AEST 1990
In article <1990Oct15.181918.8325 at cubmol.bio.columbia.edu> ping at cubmol.bio.columbia.edu (Shiping Zhang) writes:
>In order to test if crontab works for, I prepared the follow
>script file called test which is chmoded excusable
>
>#!/usr/bin/csh
># the script file
>echo test crontab
>
>and created the crontab file with a single line in the format:
>
>min h * * * /wholepath/test
>
>The script is invoked at specified time but aborted at very begining.
>I got the following message from the system:
>
>Subject: Output from "cron" command
>Status: R
>
>Your "cron" job
>
>/wholepath/test
>
>produced the following output:
>
>TERM: Undefined variable.
>
>
>I tried the following:
>min h * * * export TERM; /wholepath/test
>min h * * * set TERM; export TERM; /wholepath/test
>min h * * * set TERM termname; export TERM; /wholepath/test
>etc...
>But non of them worked.
>However, if it was invoked in the root crontab, it worked fine.
>Can anyone point out to me what is the problem?
>Thanks.
>
>-ping
This is because cron is executing your command (shell script or not) under
your uid. It will do something similar to 'su - your_uid' to also pick
up your environment definitions and then execute your command(s). I'd
check your .cshrc/.login (if you are using csh) or .profile (if sh).
When cron is executing something like this, there is no controlling terminal.
Something in your .cshrc/.login/.profile is doing I/O to the terminal and
I think that is what cron is complaining about. Check for echo's, read's,
etc.
-- Tin
--
.----------------------------------------------------------------------
. Tin Le Work Internet: tin at smsc.Sony.COM
. Sony Microsystems UUCP: {uunet,mips}!sonyusa!tin
. Work: (408) 944-4157 Home Internet: tin at szebra.UUCP
More information about the Comp.unix.internals
mailing list