From owner-freebsd-questions@FreeBSD.ORG Wed Jan 17 04:05:58 2007 Return-Path: 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 0DB3E16A40F for ; Wed, 17 Jan 2007 04:05:58 +0000 (UTC) (envelope-from don@lizardhill.com) Received: from kermit.lizardhill.com (kermit.lizardhill.com [64.69.41.217]) by mx1.freebsd.org (Postfix) with ESMTP id EFD4A13C448 for ; Wed, 17 Jan 2007 04:05:57 +0000 (UTC) (envelope-from don@lizardhill.com) Received: from ip72-193-85-114.lv.lv.cox.net ([72.193.85.114] helo=mickey) by kermit.lizardhill.com with esmtp (Exim 4.62) (envelope-from ) id 1H71Vp-000Cny-Rr for freebsd-questions@freebsd.org; Tue, 16 Jan 2007 19:30:58 -0800 From: "Don O'Neil" To: Date: Tue, 16 Jan 2007 19:31:53 -0800 Message-ID: <01fe01c739e8$080ca1f0$0300020a@mickey> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2900.3028 Thread-Index: Acc56AfaXjDXGQYKRZGDfbsejHwSwA== Subject: CRON Script not working right. 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: Wed, 17 Jan 2007 04:05:58 -0000 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?