Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 8 Mar 2000 10:31:42 +0200
From:      Matthew West <mwest@uct.ac.za>
To:        David Kelly <dkelly@hiwaay.net>
Cc:        mark <mark@itsunix.uwc.ac.za>, freebsd-questions@FreeBSD.ORG
Subject:   Re: Crontabs
Message-ID:  <20000308103142.A32571@apotheosis.org.za>
In-Reply-To: <200003080101.TAA08106@nospam.hiwaay.net>; from "David Kelly" on Tue, Mar 07, 2000 at 07:01:59PM
References:  <mwest@uct.ac.za> <200003080101.TAA08106@nospam.hiwaay.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 07, 2000 at 07:01:59PM -0600, David Kelly wrote:
> Matthew West writes:
> > On Tue, Mar 07, 2000 at 11:19:49AM +0200, mark wrote:
> > > I'm have a problem with the crontabs ..... in Solaris 2.7
> > Why are you asking Solaris questions on a FreeBSD list?
> Back off. Its not as if he was asking Windows questions.
Whoops!  It was meant as a serious question, not as a flame.  There are
several Solaris related lists which are more suited to this kind of question.

> He's probably asking here because there is a good chance *we* know the answer.
I'm not entirely sure that this is something that should be encouraged.  The
list might end up with more noise than signal.

> Plus any Unix issue should be fair game here if somehow FreeBSD differs from
> another Unix.
Point.

> > > I have added this line to the root crontab located in /var/spool/cron/crontabs/
> > You'll probably have better luck with "crontab -e".
> I forgot if Solaris has "-e".
Solaris does indeed have "-e", as does SunOS 4.x (I don't have anything older
than that to check on).

> Hey! I'd bet mere users are not allowed into /var/spool/cron/crontabs/
> meaning Mark was editing somebody's crontab as root? Maybe it was root's
> crontab.
If you're needing to edit another user's crontab as root:
FreeBSD# crontab -u username -e
Solaris# crontab -e username

> You have to pass the crontab file thru the crontab executable in order for
> cron to know things have changed. I think.
I suspect the reason for editing the files through crontab is to allow their
syntax to be checked before cron has to deal with them.

> FreeBSD's cron keeps a crontab for root in /etc/.
A more correct name would be the "system" crontab (although it's called root's
crontab), because the root user can still have it's own crontab under "crontab
-e".

> This crontab has a slightly different format than the one users are allowed
> to use. Also *this* file is to be edited directly, which may be how bad
> habits were formed?
I've also found that this has bitten a couple of people coming over from other
UNIX environments; where they edit /etc/crontab, and then want to check it in
with "crontab < /etc/crontab".  Of course, when they do this, the extra field
breaks things, or their jobs are run in duplicate.  Perhaps this should be
documented in the comments at the top of /etc/crontab?

--
mwest@uct.ac.za


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




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