Date: Fri, 09 Sep 2005 15:44:18 +0200 From: Frank Mueller - emendis GmbH <Frank.Mueller@emendis.de> To: webmaster@freshtraxxx.com Cc: freebsd-questions@freebsd.org Subject: Re: Help running shell script from cron Message-ID: <432191B2.6080902@emendis.de> In-Reply-To: <432186BD.1030702@freshtraxxx.com> References: <432186BD.1030702@freshtraxxx.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Always use full path in Scrips, e.g. /bin/echo ....... /usr/local/bin/php ...... Greetz, Ice Sandy Knight schrieb: > 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 > _______________________________________________ > 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" -- Frank Mueller eMail: Frank.Mueller@emendis.de Mobil: +49.177.6858655 Fax: +49.951.3039342 emendis GmbH Hofmannstr. 89, 91052 Erlangen, Germany Fon: +49.9131.817361 Fax: +49.9131.817386 Geschaeftsfuehrer: Gunter Kroeber, Volker Wiesinger Sitz Erlangen, Amtsgericht Fuerth HRB 10116
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?432191B2.6080902>