Discussion:
Creating periodic cron jobs
Robert Fitzpatrick
2004-05-13 15:51:44 UTC
Permalink
I am trying to create a quarter-daily cron job on my FreeBSD 5.2.1 as
follows in /etc/crontab:

05 0,6,12,18 * * * root periodic quarter-daily

I created the /etc/periodic/quarter-daily directory and placed my script
there. After I ran 'crontab -u root /etc/crontab', now I am getting
these mail messages below, it seems I have created, for example, cron
jobs as 'root /usr/libexec/atrun' in addition to the usual
'/usr/libexec/atrun'. It has done this for daily, weekly, etc. as well.
Can someone tell me what I did wrong?

Return-Path: <***@esmtp.webtent.net>
Received: from esmtp.webtent.net ([unix socket]) by esmtp.webtent.net
(Cyrus v2.1.16) with LMTP; Thu, 13 May 2004 11:45:01 -0400
X-Sieve: CMU Sieve 2.2
Received: from localhost (localhost.webtent.net [127.0.0.1]) by
esmtp.webtent.net (WebTent ESMTP Postfix Internet Mail Gateway)
with ESMTP
id 2734CEBD26 for <***@esmtp.webtent.net>; Thu, 13 May 2004
11:45:01 -0400
(EDT)
Received: from esmtp.webtent.net ([127.0.0.1]) by localhost
(esmtp.webtent.net [127.0.0.1]) (amavisd-new, port 10024) with
ESMTP id
22701-08 for <***@esmtp.webtent.net>; Thu, 13 May 2004 11:45:01
-0400 (EDT)
Received: by esmtp.webtent.net (WebTent ESMTP Postfix Internet Mail
Gateway, from userid 0) id 053C8EBD24; Thu, 13 May 2004 11:45:01
-0400 (EDT)
From: ***@esmtp.webtent.net (Cron Daemon)
To: ***@esmtp.webtent.net
Subject: Cron <***@esmtp> root /usr/libexec/atrun
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Message-Id: <***@esmtp.webtent.net>
Date: Thu, 13 May 2004 11:45:01 -0400 (EDT)
X-Virus-Scanned: by the WebTent ESMTP Postfix Internet Mail Gateway
X-Evolution-Source: imap://admin;auth=CRAM-***@esmtp.webtent.net/
Mime-Version: 1.0

root: not found
--
Robert
platanthera
2004-05-13 16:05:12 UTC
Permalink
Post by Robert Fitzpatrick
I am trying to create a quarter-daily cron job on my FreeBSD 5.2.1 as
05 0,6,12,18 * * * root periodic quarter-daily
I created the /etc/periodic/quarter-daily directory and placed my script
there. After I ran 'crontab -u root /etc/crontab',
have a look at
http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/admin.html#ROOT-NOT-FOUND-CRON-ERRORS
Post by Robert Fitzpatrick
now I am getting
these mail messages below, it seems I have created, for example, cron
jobs as 'root /usr/libexec/atrun' in addition to the usual
'/usr/libexec/atrun'. It has done this for daily, weekly, etc. as well.
Can someone tell me what I did wrong?
Received: from esmtp.webtent.net ([unix socket]) by esmtp.webtent.net
(Cyrus v2.1.16) with LMTP; Thu, 13 May 2004 11:45:01 -0400
X-Sieve: CMU Sieve 2.2
Received: from localhost (localhost.webtent.net [127.0.0.1]) by
esmtp.webtent.net (WebTent ESMTP Postfix Internet Mail Gateway)
with ESMTP
11:45:01 -0400
(EDT)
Received: from esmtp.webtent.net ([127.0.0.1]) by localhost
(esmtp.webtent.net [127.0.0.1]) (amavisd-new, port 10024) with
ESMTP id
-0400 (EDT)
Received: by esmtp.webtent.net (WebTent ESMTP Postfix Internet Mail
Gateway, from userid 0) id 053C8EBD24; Thu, 13 May 2004 11:45:01
-0400 (EDT)
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Date: Thu, 13 May 2004 11:45:01 -0400 (EDT)
X-Virus-Scanned: by the WebTent ESMTP Postfix Internet Mail Gateway
Mime-Version: 1.0
root: not found
Robert Fitzpatrick
2004-05-13 16:28:20 UTC
Permalink
Post by platanthera
Post by Robert Fitzpatrick
I am trying to create a quarter-daily cron job on my FreeBSD 5.2.1 as
05 0,6,12,18 * * * root periodic quarter-daily
I created the /etc/periodic/quarter-daily directory and placed my script
there. After I ran 'crontab -u root /etc/crontab',
have a look at
http://www.freebsd.org/doc/en_US.ISO8859-1/books/faq/admin.html#ROOT-NOT-FOUND-CRON-ERRORS
OK, thanks, that seems to have worked, just not informing the system.
But now when my script runs in the 'quarter-hourly' directory, I get the
following, the script is running fine:

mail: illegal option -- a
Usage: mail [-EiInv] [-s subject] [-c cc-addr] [-b bcc-addr] to-addr ...
[- sendmail-options ...]
mail [-EiInNv] -f [name]
mail [-EiInNv] [-u user]

Of course, I'm not getting the mail message that the cron would normally
produce.
--
Robert
Continue reading on narkive:
Loading...