Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 5 May 2000 13:52:23 +1000
From:      "Richard Grace" <rgrace@itworks.com.au>
To:        "Jonathan Chen" <Jonathan.Chen@itouch.co.nz>, "Doug Young" <dougy@gargoyle.apana.org.au>
Cc:        <freebsd-questions@freebsd.org>
Subject:   RE: "bad day_of_the_month" (yes really !!!) cron questions
Message-ID:  <NDBBILBEBIHJBLOEIKKCIEBBCHAA.rgrace@itworks.com.au>
In-Reply-To: <20000505145429.B798@jonc.itouch.co.nz>

next in thread | previous in thread | raw e-mail | index | archive | help
> Hang on there, you've just attached a binary executable! I hope you're
> not trying to feed *that* to crontab(1). You need to have a file having
> the contents with something like:
>
>     #
>     #   Personal crontab
>     #
>     # Environment
>
> PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:
> /home/jonc/bin
>     #
>     #Min    Hr      MnDy    Month   WkDy    Command
>     */5     6-20    *       *       *       fetchmail --silent >
> /dev/null 2>&1
>
> and feed that file to crontab(1).

Yep, or 'crontab -e' will let you edit your crontab using $EDITOR.

There are also environment variables for each crontab, here's one I use to
run scripts...

--- cut here ---
# Richard's experimental snmp code
SHELL=/bin/sh
MAILTO=rgrace@itworks.com.au
40 * * * * /home/rgrace/port-acct/port-acct.pl 2>&1
--- cut here ---

This runs a script at 40 mins past the hour, using /bin/sh and sends the
stdout and stderr to me via email.  I have a .forward file which then sends
the mail to other relevant people.

Have fun with cron...

Richard Grace



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?NDBBILBEBIHJBLOEIKKCIEBBCHAA.rgrace>