Mailinglist Archive: opensuse (4053 mails)

< Previous Next >
Re: [SLE] CRON
  • From: (Ted Harding) <Ted.Harding@xxxxxxxxxxxxxxxx>
  • Date: Tue, 28 Aug 2001 10:48:41 +0100 (BST)
  • Message-id: <XFMail.010828104841.Ted.Harding@xxxxxxxxxxxxxxxx>
On 27-Aug-01 Bruce Marshall wrote:
> On Monday 27 August 2001 05:21 pm, Ray Booysen wrote:
>> is the path needed. I need to send a signal. I want to run "killall
>> -TERM
>> proxyper" as the command. Will this work
>> as it is?
>
> Dunno... You'd have to try it. I suspect the path is needed.

I'd reccomend always putting in the full path; that way you're
safe.

Cron sets up some environment variables for the commands it runs
according to the user who owns the crontab file. For instance,
it picks up $HOME from the user's entry in /etc/passwd (see
man 5 crontab). So you could certainly have a crontab line like

* * * * * $HOME/bin/myprog

But $PATH is very much a "dynamic" variable for a user, and there's
no reliable way cron could look for a user's particular current
$PATH.

If you want to make sure that cron uses a particular $PATH you can
set this in the crontab file, with a line like

PATH="/the/path:/you/want:/to/use"

(nothing else: this sort of crontab line is not time-linked and
so is global) in which case you can omit full paths from the cron
commands provided they're covered by the crotab $PATH.

Ted.

--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding@xxxxxxxxxxxxxxxx>
Fax-to-email: +44 (0)870 167 1972
Date: 28-Aug-01 Time: 10:48:41
------------------------------ XFMail ------------------------------

< Previous Next >
References