From owner-freebsd-questions@FreeBSD.ORG Fri Sep 9 12:57:36 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org 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 545BC16A41F for ; Fri, 9 Sep 2005 12:57:36 +0000 (GMT) (envelope-from webmaster@freshtraxxx.com) Received: from ws5.spacesurfer.com (ws5.spacesurfer.com [66.197.185.165]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9850643D46 for ; Fri, 9 Sep 2005 12:57:35 +0000 (GMT) (envelope-from webmaster@freshtraxxx.com) Received: from ws5.spacesurfer.com (localhost.spacesurfer.com [127.0.0.1]) by ws5.spacesurfer.com (Postfix) with ESMTP id 3537D5C074 for ; Fri, 9 Sep 2005 12:57:34 +0000 (GMT) Received-SPF: pass (ws5.spacesurfer.com: domain of webmaster@freshtraxxx.com designates 66.197.185.165 as permitted sender) Received: from [192.168.1.10] (easyconnect2121136-110.clients.easynet.fr [212.11.36.110]) by ws5.spacesurfer.com (Postfix) with ESMTP for ; Fri, 9 Sep 2005 12:57:32 +0000 (GMT) Message-ID: <432186BD.1030702@freshtraxxx.com> Date: Fri, 09 Sep 2005 14:57:33 +0200 From: Sandy Knight User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: freebsd-questions@freebsd.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Help running shell script from cron X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: webmaster@freshtraxxx.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Sep 2005 12:57:36 -0000 I am having trouble configuring my shell scripts to run under cron (user level, not root). I have set up a test.sh script which sends me an email, it works fine from the command line (ssh). the script is as follows: #!/bin/sh echo "helloworld" | mail -s "helloworld" user@domain.com php /home/a_user/cron/test.php As you can see I am also trying to get a php script to run (this is my ultimate aim). My crontab is as follows: # /home/a_user # SHELL=/bin/sh PATH=/home/a_user/cron HOME=/home/a_user # # #minute hour mday month wday command # # */5 * * * * /home/a_user/cron/test.sh I have done the following: $ pwd /home/a_user $ crontab cron/myCronTab $ crontab -l {output - see above} Crontab is trying to run my script as I receive an email every 5 minutes saying: /home/a_user/cron/test.sh: not found The permissions for the scripts are: $ ls -lt cron/ -rw-r--r-- 1 a_user vusers 322 Sep 9 12:27 myCronTab -rwxr-xr-x 1 a_user vusers 107 Sep 9 12:16 test.sh -rwxr-xr-x 1 a_user vusers 99 Sep 4 17:58 test.php Thank you in advance, Sandy