From owner-freebsd-questions@FreeBSD.ORG Thu Nov 3 21:17:57 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D3C6E16A437 for ; Thu, 3 Nov 2005 21:17:57 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from aiolos.otenet.gr (aiolos.otenet.gr [195.170.0.93]) by mx1.FreeBSD.org (Postfix) with ESMTP id 312E443D5D for ; Thu, 3 Nov 2005 21:17:52 +0000 (GMT) (envelope-from keramida@ceid.upatras.gr) Received: from flame.pc (aris.bedc.ondsl.gr [62.103.39.226]) by aiolos.otenet.gr (8.13.4/8.13.4/Debian-1) with SMTP id jA3LHon9019367; Thu, 3 Nov 2005 23:17:50 +0200 Received: from flame.pc (flame [127.0.0.1]) by flame.pc (8.13.4/8.13.4) with ESMTP id jA3LHhoe029904; Thu, 3 Nov 2005 23:17:43 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Received: (from keramida@localhost) by flame.pc (8.13.4/8.13.4/Submit) id jA3LHhiv029903; Thu, 3 Nov 2005 23:17:43 +0200 (EET) (envelope-from keramida@ceid.upatras.gr) Date: Thu, 3 Nov 2005 23:17:43 +0200 From: Giorgos Keramidas To: Brandon Hinesley Message-ID: <20051103211743.GA26026@flame.pc> References: <001101c5e0b9$d1cb4b60$6800a8c0@BrandonH> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <001101c5e0b9$d1cb4b60$6800a8c0@BrandonH> Cc: freebsd-questions@freebsd.org Subject: Re: Cron Job will not run. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Nov 2005 21:17:59 -0000 On 2005-11-03 13:01, Brandon Hinesley wrote: >Alex Zbyslaw [mailto:xfb52@dial.pipex.com] wrote: >> Brandon Hinesley wrote: >>> The script below works perfectly when I run it from a >>> console, however, nothing at all seems to happen as evidenced >>> by the backups not being rotated. I don't know if this makes >>> a difference, but the "Backup" folder is a file system on an >>> external hard drive. I am also using samba to share that >>> folder as r/o. >>> >>> [...] >>> Here's part of my /etc/crontab: >>> -------------------- >>> SHELL=/bin/sh >>> PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin >>> [...] >>> rsync -av --delete $files/$docs $dbkups/0/ >> >> This is a FAQ, though I don't know if it's in the FAQ :-) >> >> From the command line /usr/local/bin (where rsync lives) is in >> your path. From Cron it is not. Either add it to the crontab >> or set PATH in your script. The latter is recommended since >> the script works whatever the running user has their path set >> to. There may be some other path problem I've missed, but this >> ones sticks out. > > I added /usr/local/bin to /etc/crontab > > PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/sbin:/usr/local/bin > > It's still not working. It doesn't seem to run anything in the > script at all; rotations or rsync'n. Merely adding it as an assignment is not enough for child processes of the cron script to 'see' the value. Make sure you also 'export' the new PATH: PATH='...' export PATH Then the rsync process will use the new PATH.