Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 07 Jan 2012 16:31:40 +0200
From:      Kaya Saman <kayasaman@gmail.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: Having problems running shell script from crontab
Message-ID:  <4F08574C.5020001@gmail.com>
In-Reply-To: <20120107135743.6aa5a6bd@gumby.homeunix.com>
References:  <4F0838DF.40006@gmail.com> <20120107132234.31d04a1c@gumby.homeunix.com> <4F084AAD.3050301@gmail.com> <20120107135743.6aa5a6bd@gumby.homeunix.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 01/07/2012 03:57 PM, RW wrote:
> On Sat, 07 Jan 2012 15:37:49 +0200
> Kaya Saman wrote:
>
> n terms of paths this is what I'm doing: I'm in a FreeBSD jail
>> logged in by - #jexec<jail>  tcsh
>>
>> which gets me in as root. Crontab is being run as root so paths
>> should be the same no?
> PATH is set at the top of /etc/crontab
> _______________________________________________
> 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"

Ok, sorry for being slow but I still don't understand how the PATH 
variable is connected to restarting tomcat?

This is the default PATH in /etc/crontab: 
PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin

but where my script seems to not work well when run is at this point: 
/usr/local/etc/rc.d/tomcat6 restart


Does this mean that putting :/usr/local/etc to the PATH statement will 
enable crontab to understand the .../etc/rc.d/ script variables?


I think where I'm getting confused is that I'm using 'absolute' paths 
and my knowledge of the PATH is when one wants to run a command 
specifically from a shell; as in 'top'. so you wouldn't need to run 
/usr/bin/top.


Regards,


Kaya



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