From owner-freebsd-questions Tue May 1 9:14:30 2001 Delivered-To: freebsd-questions@freebsd.org Received: from dire.bris.ac.uk (dire.bris.ac.uk [137.222.10.60]) by hub.freebsd.org (Postfix) with ESMTP id 3060037B423 for ; Tue, 1 May 2001 09:14:27 -0700 (PDT) (envelope-from Jan.Grant@bristol.ac.uk) Received: from mail.ilrt.bris.ac.uk by dire.bris.ac.uk with SMTP-PRIV with ESMTP; Tue, 1 May 2001 17:00:16 +0100 Received: from cmjg (helo=localhost) by mail.ilrt.bris.ac.uk with local-esmtp (Exim 3.16 #1) id 14ucYr-0002qE-00; Tue, 01 May 2001 16:59:37 +0100 Date: Tue, 1 May 2001 16:59:37 +0100 (BST) From: Jan Grant To: Peter Brezny Cc: freebsd-questions Subject: Re: Simple problem running scripts from cron In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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