[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: What's the problem with this cron command



On Sat, Mar 15, 2008 at 5:42 PM, T o n g <mlist4suntong@yahoo.com> wrote:
> On Sat, 15 Mar 2008 12:19:10 -0700, David Fox wrote:
>
>  >> Please take a look at the following cron task:
>  >>
>  >> * * * * *    root    ps -eaf | grep -E 'cdrecord.* -[dts]ao |cdrdao
>  >> *write|growisofs.*speed=' > /dev/null || logger get executed.
>  >
>  > I'm not exactly sure why you want to do that  - the five asterisks
>  > mean run this command every minute of every day.
>
>  It is for testing.
>
>  >> PS. I'm sure the PATH is setup properly in my cron, so cron can find ps
>  >> & grep.
>  >
>  > cron runs in a restricted environment and doesn't (to my knowledge)
>  > source $PATH from anywhere, so you need to explicitly add the paths
>  > (i.e., /usr/bin/cdrecord) or run a shell script that sets those & then
>  > runs your command.
>
>  You are only partly true. FYI, I can invoke my own command from
>  un-standard (ie weird) places without specifying path.

YOU may well be able to do that, but cron almost certainly cannot,
without explicit path information (as was just suggested).

Patrick


Reply to: