From owner-freebsd-questions@FreeBSD.ORG  Wed Jan 17 10:41:51 2007
Return-Path: <owner-freebsd-questions@FreeBSD.ORG>
X-Original-To: freebsd-questions@freebsd.org
Delivered-To: freebsd-questions@freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id E88E716A741
	for <freebsd-questions@freebsd.org>;
	Wed, 17 Jan 2007 10:41:50 +0000 (UTC)
	(envelope-from derek@computinginnovations.com)
Received: from betty.computinginnovations.com
	(dsl081-227-250.chi1.dsl.speakeasy.net [64.81.227.250])
	by mx1.freebsd.org (Postfix) with ESMTP id 6B99413C45D
	for <freebsd-questions@freebsd.org>;
	Wed, 17 Jan 2007 10:41:48 +0000 (UTC)
	(envelope-from derek@computinginnovations.com)
Received: from p28.computinginnovations.com
	(dhcp-10-20-30-100.computinginnovations.com [10.20.30.100])
	(authenticated bits=0)
	by betty.computinginnovations.com (8.13.8/8.12.11) with ESMTP id
	l0HAf0RA083438; Wed, 17 Jan 2007 04:41:05 -0600 (CST)
Message-Id: <6.0.0.22.2.20070117043924.025926e8@mail.computinginnovations.com>
X-Sender: derek@mail.computinginnovations.com
X-Mailer: QUALCOMM Windows Eudora Version 6.0.0.22
Date: Wed, 17 Jan 2007 04:40:42 -0600
To: "Don O'Neil" <don@lizardhill.com>, <freebsd-questions@freebsd.org>
From: Derek Ragona <derek@computinginnovations.com>
In-Reply-To: <01fe01c739e8$080ca1f0$0300020a@mickey>
References: <01fe01c739e8$080ca1f0$0300020a@mickey>
Mime-Version: 1.0
X-ComputingInnovations-MailScanner-Information: Please contact the ISP for
	more information
X-ComputingInnovations-MailScanner: Found to be clean
X-ComputingInnovations-MailScanner-From: derek@computinginnovations.com
X-Spam-Status: No
Content-Type: text/plain; charset="us-ascii"; format=flowed
X-Content-Filtered-By: Mailman/MimeDel 2.1.5
Cc: 
Subject: Re: CRON Script not working right.
X-BeenThere: freebsd-questions@freebsd.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: User questions <freebsd-questions.freebsd.org>
List-Unsubscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions>
List-Post: <mailto:freebsd-questions@freebsd.org>
List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help>
List-Subscribe: <http://lists.freebsd.org/mailman/listinfo/freebsd-questions>, 
	<mailto:freebsd-questions-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 17 Jan 2007 10:41:51 -0000

Always use full pathnames to commands in cron scripts.  Change the lines to 
include the full paths for chown and chmod.

         -Derek


At 09:31 PM 1/16/2007, Don O'Neil wrote:
>Anybody have any clues why a shell script run from root's CRON would act
>differently then when run directly from the command line?
>
>Specifically, I have a script that looks for files on a NFS mount point and
>copies them across and changes the ownership/perms.
>
>Here's the gist of the script:
>
>#!/bin/sh
>TDIR=`date +%m%d%y%s`
>mkdir /tmp/$TDIR
>mv /source/* /tmp/$TDIR/
>chown user:group /tmp/$TDIR/*
>chmod 660 /tmp/$TDIR/*
>mv /tmp/$TDIR/* /destination/
>
>When run from roots CRON it does everything but the chmod correctly, which
>is strange. When I run it from the command line as root it works fine as
>expected.
>
>I'm running 6.1-STABLE-200608.
>
>Any clues?
>
>_______________________________________________
>freebsd-questions@freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"
>
>--
>This message has been scanned for viruses and
>dangerous content by MailScanner, and is
>believed to be clean.
>MailScanner thanks transtec Computers for their support.

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
MailScanner thanks transtec Computers for their support.