Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 4 May 2000 21:31:10 -0500 (CDT)
From:      Brennan W Stehling <brennan@offwhite.net>
To:        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:  <Pine.BSF.4.10.10005042124300.55716-100000@home.offwhite.net>
In-Reply-To: <01be01bfb638$6d9c0af0$847e03cb@ROADRUNNER>

next in thread | previous in thread | raw e-mail | index | archive | help
You can run any binary or script from a crontab. I usually use shell
scripts, but if I am mucking with a database I use perl.

If you want to mail the contents of a file you can use the mail binary.
Here is a line you can add directly to your crontab to get nightly
mailings.

30 01 * * * cat /var/log/message | mail -s "nightly" you@there.com

Change the subject and destination as necessary.  The drawback is that the
contents of the file are in the body of the mail, not as an attachement.
If you want to do that, you could use a perl script.

Brennan Stehling - web developer and sys admin
projects: www.greasydaemon.com | www.onmilwaukee.com | www.sncalumni.com

fortune:
Living on Earth may be expensive, but it includes an annual free trip
around the Sun.

On Fri, 5 May 2000, Doug Young wrote:

> Thanks Brennan
> 
> > When you set a cron job, you need to insert it into you cron file.  This
> > is explained in the con manpage so I will be brief.
> >
> My "man cron" is only about 20 lines long, and there's not so much as a
> mention of
> how one "sets" a cron job. "Man crontab" is only slightly less cryptic,  and
> again fails to tell one anything of value about the system crontab, or how
> to specify a particular job to be run. All I can find on the subject in the
> mailing list archives suggests that its not a good thing to use "crontab"
> with any switch to edit the system crontab.
> 
> > I personally get confused when I set set cron jobs, so I always have cheat
> > notes in that file.
> 
> I  get confused trying to comprehend man pages !!! Seems the writers of
> those things assume the reader is either a mind-reader or an expert who
> doesn't  need to be told most of the critical points that are left out.
> 
> Your sample crontab suggests the use of perl ..... I wouldn't know a perl
> script if one attacked me in the night, so is that something critical to
> using crontabs as such or just something you've developed for a particular
> job ??
> 
> Somehow I've gotta figure out how to tell "mail" to send stuff like ppp.log
> to a given email address. Since it appears that this is not covered at all
> in the various man pages / handbook / Complete FreeBSD,  where does one go
> for a straightforward explanation of all the steps / terminology / syntax /
> whatever else is required to get it to work ??
> 
> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 




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?Pine.BSF.4.10.10005042124300.55716-100000>