From owner-freebsd-questions@FreeBSD.ORG Tue Feb 24 14:50:01 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D4E8916A4CE for ; Tue, 24 Feb 2004 14:50:01 -0800 (PST) Received: from mxfep01.bredband.com (mxfep01.bredband.com [195.54.107.70]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6ADFF43D2D for ; Tue, 24 Feb 2004 14:49:29 -0800 (PST) (envelope-from mathias@haas.se) Received: from haas.se ([213.114.148.49] [213.114.148.49]) by mxfep01.bredband.com with SMTP id <20040224224928.EDPQ13599.mxfep01.bredband.com@haas.se> for ; Tue, 24 Feb 2004 23:49:28 +0100 Received: (qmail 30435 invoked from network); 24 Feb 2004 22:54:59 -0000 Received: from mathias@haas.se by p3-550.haas.se by uid 82 with qmail-scanner-1.20 (spamassassin: 2.61. Clear:RC:1(192.168.10.10):. Processed: 54:59 -0000 Received: from unknown (HELO haas.se) (192.168.10.10) by: 54:58 -0000 Message-ID: <403BD4F8.40101@haas.se> Date: Tue, 24 Feb 2004 23:49:28 +0100 From: Mathias Haas User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031205 Thunderbird/0.4 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Julien Gabel References: <51804.193.14.163.194.1077641809.squirrel@mail.haas.se><403B9112.1080503@circlesquared.com><52540.192.168.0.97.1077646240.squirrel@webmail.thilelli.net><403B952C.4060706@haas.se> <403BC43B.6030003@infinitebubble.com> <53781.192.168.0.97.1077659656.squirrel@webmail.thilelli.net> In-Reply-To: <53781.192.168.0.97.1077659656.squirrel@webmail.thilelli.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-questions@freebsd.org Subject: Re: Shell scripting woes. X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: mathias@haas.se List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Feb 2004 22:50:01 -0000 Julien Gabel wrote: >>>As a reply to both answers, here's a script that wont' run: >>>#!/usr/local/bin/bash >>>echo start > test.txt >>> >>>...and here is bash: >>>[root@p3-550 /usr/local/etc]>> whereis bash >>>bash: /usr/local/bin/bash >>> >>>this is /var/log/cron >>>Feb 24 19:20:00 p3-550 /usr/sbin/cron[27988]: (root) CMD >>>(/usr/local/etc/test.sh) >>> >>>This is the crontab entry: >>>* * * * * /usr/local/etc/test.sh >>>(At the moment, I have no shell parameters or other parameters in >>>crontab, another crontab-job runs fine, but that's an executable >>>file.) >>> >>> > > >The following works fine, here is the detail: > >$ date ; ls -lF /tmp/test.* >Tue Feb 24 22:50:11 CET 2004 >-rwxr-x--- 1 jgabel wheel 49 Feb 24 22:50 /tmp/test.bash* >$ >$ cat /tmp/test.bash >#!/usr/local/bin/bash >echo start > /tmp/test.txt >$ >$ crontab -l >* * * * * /tmp/test.bash >$ >$ date ; ls -lF /tmp/test.* >Tue Feb 24 22:51:17 CET 2004 >-rwxr-x--- 1 jgabel wheel 49 Feb 24 22:46 /tmp/test.bash* >-rw-r--r-- 1 jgabel wheel 6 Feb 24 22:51 /tmp/test.txt >$ >$ cat /tmp/test.txt >start >$ > >Can you try *stricly* the same thing? > > > Sure (this is run as root): $ cd /tmp $ date ; ls -lF /tmp/test.* Tue Feb 24 23:25:56 CET 2004 -rwxr-x--- 1 root wheel 45 Feb 24 23:24 /tmp/test.bash* $ $ cat test.bash #!/usr/local/bin/bash echo start > test.txt $ crontab -l * * * * * /usr/local/sbin/pure-ftpwho -w > /www/data/ftpstatus.html * * * * * /tmp/test.bash $ date ; ls -lF /tmp/test.* Tue Feb 24 23:26:08 CET 2004 -rwxr-x--- 1 root wheel 45 Feb 24 23:24 /tmp/test.bash* $ Not much of difference I'm afraid.