Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 May 2001 16:59:37 +0100 (BST)
From:      Jan Grant <Jan.Grant@bristol.ac.uk>
To:        Peter Brezny <peter@sysadmin-inc.com>
Cc:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Simple problem running scripts from cron
Message-ID:  <Pine.GSO.4.31.0105011658240.8905-100000@mail.ilrt.bris.ac.uk>
In-Reply-To: <MFEFLELMIJGKDKPCJHAFKEFGCBAA.peter@sysadmin-inc.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 1 May 2001, Peter Brezny wrote:

> I use a file very similar to the one below to compress backup files on a
> monthly basis.
>
> When i run the script from the console it works fine, however, when cron
> tries to run it, this error appears in the logs.
>
> /usr/bin/tar: can't exec bzip2 : No such file or directory
>
> Why does it work from the console, but not when cron tries to run it?
>
> Am i just missing a path statement to /usr/local/bin/bzip2 ?
Sounds very much like it.

> And would that syntax be:
>
> PATH=/usr/local/bin/

Better, perhaps, to include a full path (although in this case it
doesn't look like it'll need it)...

> #!/bin/sh

PATH=/usr/local/bin:/usr/bin:/bin
export PATH

> (nice /usr/bin/tar cvflj /home/test.bz2
> /home/peter/aaa)>/home/peter/test.bzip.log 2>&1

That ought to do it.


-- 
jan grant, ILRT, University of Bristol. http://www.ilrt.bris.ac.uk/
Tel +44(0)117 9287163 Fax +44 (0)117 9287112 RFC822 jan.grant@bris.ac.uk
Strive to live every day as though it was last Wednesday.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.31.0105011658240.8905-100000>