CRON Script not working right.

Derek Ragona derek at computinginnovations.com
Wed Jan 17 10:41:51 UTC 2007


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 at freebsd.org mailing list
>http://lists.freebsd.org/mailman/listinfo/freebsd-questions
>To unsubscribe, send any mail to "freebsd-questions-unsubscribe at 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.



More information about the freebsd-questions mailing list