Gentoo Archives: gentoo-user

From: Jeremi Piotrowski <jeremi.piotrowski@×××××.com>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] dcron problem on new install
Date: Thu, 26 Nov 2015 10:48:08
Message-Id: 20151126104749.GB17749@gentoo-tp
In Reply to: [gentoo-user] dcron problem on new install by waltdnes@waltdnes.org
1 On Wed, Nov 25, 2015 at 10:29:52PM -0500, waltdnes@××××××××.org wrote:
2 > I'm getting a bunch of messages like...
3 >
4 > > Subject: cron for user root root [ ! -x /etc/cron.hourly/0anacron ] && { test -x /usr/sbin/run-crons && /usr/sbin/run-crons ; }
5 > >
6 > > /bin/sh: root: command not found
7 >
8 > /bin/sh does exist...
9 >
10 > [d531][waltdnes][~] ll /bin/sh
11 > lrwxrwxrwx 1 root root 4 Nov 24 12:10 /bin/sh -> bash
12 >
13 > /etc/ cron.hourly cron.weekly cron.monthly are empty except for a
14 > dummy file .keep_sys-process_cronbase-0
15 >
16
17 What /bin/sh actually means is "root: command not found". This is caused
18 by the difference between the system-wide crontab and the per-user
19 crontab.
20
21 The system-wide crontab /etc/crontab needs to know as which user to
22 execute the command so it has a column for the username right before the
23 command. The per-user crontabs which are at /var/spool/cron/crontabs (but
24 which should be edited with crontab -e) know as which user to run the
25 commands so they treat everything after the time as the command.
26
27 You got the two mixed up. Run crontab -e as the root user and remove
28 the word 'root' part right before the command. Should fix things right
29 away.