Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Jan 2007 19:31:53 -0800
From:      "Don O'Neil" <don@lizardhill.com>
To:        <freebsd-questions@freebsd.org>
Subject:   CRON Script not working right.
Message-ID:  <01fe01c739e8$080ca1f0$0300020a@mickey>

next in thread | raw e-mail | index | archive | help
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?




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?01fe01c739e8$080ca1f0$0300020a>