Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 1999 15:09:55 +0200
From:      Stefano Riva <sriva@alice.it>
To:        Rudi Opperman <rudi@askas.co.za>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: help with cron and crontab mail messages
Message-ID:  <3.0.5.32.19990421150955.00aa1550@relay.alice.it>
In-Reply-To: <371DB989.99A129BE@askas.co.za>

next in thread | previous in thread | raw e-mail | index | archive | help
At 13.42 21/04/99 +0200, you wrote:
>I am trying to customise cron to run some afterhours tasks.  It seems
>that you just add the tasks in the specified users crontab file and load
>it.  This is quite simple and works well.  However these jobs need to
>run as root.  I checked root's loaded crontab and it was empty - so i
>added to jobs to /etc/crontab and loaded it.  I then recieved mail every

  /etc/crontab it's in a slightly different format than users' crontab.
Actually, it's the "main" system crontab table. IMO, it would be better to
use it instead of specific users' tables, whenever possible, because it's
easier to manage the system's global load when you have many demanding
timed tasks; there's one single point where you can see and modify what is
scheduled to run.
  What do you mean with "I added the jobs to /etc/crontab and loaded it"?
You don't have to load anything. If cron is running normally, it checks
every minute the modtime of /etc/crontab and, if it's changed, loads it
automagically.

>five minutes from
>
>	*/5     *       *       *       *       root    /usr/libexec/atrun
>
>This is quite annoying.  (12x24 messages a day just from this entry).  I

  I don't see why you started to get those messages from atrun after adding
other jobs to /etc/crontab. Anyway, to turn off mailing for a command,
simply redirect its output to /dev/null. When needed, redirect the error
output too:

*	*	*	*	*	root	/root/myprog > /dev/null 2>&1

>Moreover why was root's "crontab -u root -l" reporting nothing even
>though rc.conf has cron_enable="YES"?  
>Does this mean that these jobs were never run or does it mean that they
>were run in some other user/operator crontab ?

  /etc/crontab isn't the same as crontab -u root, as I said.

  cron_enable="YES" enables cron's loading at boot by rc; nothing less,
nothing more. Do a ps to see if cron is really running. Check /var/cron/log
to see if a specific command has been run.

---

  Stefano Riva
  Software Engineer - Systems Administrator
  Informazioni Editoriali I.E. Srl
  Phone +39-027528400, Fax +39-027528451
  Email sriva@alice.it


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?3.0.5.32.19990421150955.00aa1550>