لم تعُد "مجموعات Google" تتيح المشاركات أو الاشتراكات الجديدة من Usenet. وسيبقى بالإمكان عرض المحتوى السابق.

CRON: /bin/bash: root: command not found

824 مرّة مشاهدة
التخطي إلى أول رسالة غير مقروءة

Stefan Davids

غير مقروءة،
18‏/01‏/1999، 3:00:00 ص18‏/1‏/1999
إلى
On Mon, 11 Jan 1999 11:46:18 +0100, Miguel Angel Moreno wrote:
> I have a problem with one of my linux machines. I've installed Red Hat
> 4.2, the same version as my other three computers, but in this
> computer it sends a message to the root each minute saying "root:
> command not found". I tried to remove the error line, and the error
> jumps to the next crontab line. Why? :D

<snip>

> My cron sends this message:
>
> ----------------------
> From: xxxxxxxxxxxxxxxxxxx (Cron Daemon)

<snip>

> /bin/bash: root: command not found
> --------------
>
> My crontab lines are:
> ---------------
> SHELL=/bin/bash
> PATH=/sbin:/bin:/usr/sbin:/usr/bin
> MAILTO=root
>
> # Run any at jobs every minute
> * * * * * root [ -x /usr/sbin/atrun ] && /usr/sbin/atrun

You don't want `root' in there. On my system, at least, anything in
/etc/crontab will run as root automatically; if you want to run it as
another user use su user -c in the relevant script.

Stefan

Brian McCauley

غير مقروءة،
19‏/01‏/1999، 3:00:00 ص19‏/1‏/1999
إلى
Miguel Angel Moreno <man...@virtualsw.es> writes:

> I have a problem with one of my linux machines. I've installed Red Hat
> 4.2, the same version as my other three computers, but in this
> computer it sends a message to the root each minute saying "root:
> command not found". I tried to remove the error line, and the error
> jumps to the next crontab line. Why? :D

There are two alternative formats for crontab used by different
implementations of cron. One format has a username field the other
does not. You have a crontab with a username field and a cron program
that uses the format without.

I do not use RH so I can't say how you got into this situation.

--
\\ ( ) No male bovine | Email: B.A.Mc...@bham.ac.uk
. _\\__[oo faeces from | Phones: +44 121 471 3789 (home)
.__/ \\ /\@ /~) /~[ /\/[ | +44 121 627 2173 (voice) 2175 (fax)
. l___\\ /~~) /~~[ / [ | PGP-fp: D7 03 2A 4B D8 3A 05 37...
# ll l\\ ~~~~ ~ ~ ~ ~ | http://www.wcl.bham.ac.uk/~bam/
###LL LL\\ (Brian McCauley) |

Bill Unruh

غير مقروءة،
20‏/01‏/1999، 3:00:00 ص20‏/1‏/1999
إلى
In <3699D679...@virtualsw.es> Miguel Angel Moreno <man...@virtualsw.es> writes:
]I have a problem with one of my linux machines. I've installed Red Hat
]4.2, the same version as my other three computers, but in this
]computer it sends a message to the root each minute saying "root:
]command not found". I tried to remove the error line, and the error
]jumps to the next crontab line. Why? :D

]Subject: Cron <root@xxxxxx> root [ -x /usr/sbin/atrun ] &&
]/usr/sbin/atrun

]/bin/bash: root: command not found
]--------------
]* * * * * root [ -x /usr/sbin/atrun ] && /usr/sbin/atrun

The rest of the line after the first 5 fields is the command. Your
command is "root" What command is root? bash is unable to find any
command called root. Thus the eroor message.1

0 رسالة جديدة