Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Jan 2007 04:40:42 -0600
From:      Derek Ragona <derek@computinginnovations.com>
To:        "Don O'Neil" <don@lizardhill.com>, <freebsd-questions@freebsd.org>
Subject:   Re: CRON Script not working right.
Message-ID:  <6.0.0.22.2.20070117043924.025926e8@mail.computinginnovations.com>
In-Reply-To: <01fe01c739e8$080ca1f0$0300020a@mickey>
References:  <01fe01c739e8$080ca1f0$0300020a@mickey>

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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6.0.0.22.2.20070117043924.025926e8>