linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Kelly <akelly@transparency.org>
To: linux-admin@vger.kernel.org
Subject: Re: Cronjobs
Date: Wed, 30 Jul 2003 12:16:52 +0200	[thread overview]
Message-ID: <3F279B14.3FDC2756@transparency.org> (raw)
In-Reply-To: 20030730080516.GZ26455@gx.nl



Stefan Wimmer wrote:
> 
> * Tom Troonbeeckx <tom.troonbeeckx@ideaxis.com> wrote on 30/Jul/2003 - 09:34:38 :
> > Dear Sir/Madam,
> >
> > I have some proplem with mine cronjobs.
> >
> > I edit mine /etc/crontab with the following command "crontab -e".
> > The crontab looks like this
> >
> > SHELL=/bin/bash
> > PATH=/sbin:/bin:/usr/sbin:/usr/bin
> > MAILTO=root
> > HOME=/
> >
> > # run-parts
> > 01 * * * * root run-parts /etc/cron.hourly
> > 01 0 * * * root run-parts /etc/cron.daily
> > 30 14 * * * root run-parts /etc/cron.twice.a.day
> > 30 18 * * * root run-parts /etc/cron.twice.a.day
> > 22 4 * * 0 root run-parts /etc/cron.weekly
> > 42 4 1 * * root run-parts /etc/cron.monthly
> > 3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
> > 1,6,11,16,21,26,31,36,41,46,51,56 * * * * root run-parts /etc/cron.5-min
> >
> > I restarted the anacron-daemon.  I tested the cronjobs individually and they
> > work fine.
> > However, since I scheduled them I receive an email after each 5 and 15
> > minutes with the message
> >       /bin/bash: root: command not found
> >
> > I figured out that the crondaemon is trying to execute the command root. At
> > some point it doesn't count the userprivilege of the cronjob.
> >
> > The configuration looks in mine opinion fine.  Any ideas what went wrong?
> >
> > Thanks in advance....
> 
> By using "crontab -e" you're editing your personal cron file (located in
> /var/spool/cron in RedHat) and there you don't need the user who is
> running the commands ... so leaving out "root" from your lines should help.
> 
> old: 3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly
> new: 3,18,33,48 * * * *      run-parts /etc/cron.quarter-hourly

Yes and no.

The differentiation here is user crontab vs. system crontab.

User crontabs only permit 6 fields
mim hour day month day-of-week do-this-part

Only the system crontab has a 7th field. The extra field
is at postion 6 and takes as an argument the username of
the user under which do-this-part is to run.

The following are equivalent:
  when logged in as user root,
  crontab -e
  3,18,33,48 * * * * run-parts /etc/cron.quarter-hourly

or edit the file /etc/crontab
  3,18,33,48 * * * * root run-parts /etc/cron.quarter-hourly

Andy

  reply	other threads:[~2003-07-30 10:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-30  7:34 Cronjobs Tom Troonbeeckx
2003-07-30  7:44 ` Cronjobs César Soler
2003-07-30  7:59 ` Cronjobs Vladimír Dvoøák
2003-07-30  8:17   ` Cronjobs Horia Chirculescu
2003-07-30  8:05 ` Cronjobs Stefan Wimmer
2003-07-30 10:16   ` Andrew Kelly [this message]
2003-07-30  8:13 ` Cronjobs Scott Taylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3F279B14.3FDC2756@transparency.org \
    --to=akelly@transparency.org \
    --cc=linux-admin@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).